diff options
author | Yeliz Taneroğlu <yeliztaneroglu@gmail.com> | 2017-05-12 18:26:56 +0300 |
---|---|---|
committer | Chris Sherlock <chris.sherlock79@gmail.com> | 2017-05-20 11:46:43 +0200 |
commit | 7bec7abd4c3d78e6a37f523f4fb599134ef51ca7 (patch) | |
tree | 4424a7760917054f056e1bf6c6d39280629a28c4 /sysui | |
parent | aa8fdfd2c2f6ba421e988a3ca85b1a1cbaeb69b8 (diff) |
tdf#105204: ShellCheck nitpicks for apparmor.sh
Double quote to prevent globbing and word splitting.
Iterating over ls output is fragile. Use globs.
Change-Id: I156b472708049115e753ff2a51a44807c8af6b94
Reviewed-on: https://gerrit.libreoffice.org/37544
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Chris Sherlock <chris.sherlock79@gmail.com>
Diffstat (limited to 'sysui')
-rwxr-xr-x | sysui/desktop/share/apparmor.sh | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/sysui/desktop/share/apparmor.sh b/sysui/desktop/share/apparmor.sh index 59803e1ae4db..cf554257cf72 100755 --- a/sysui/desktop/share/apparmor.sh +++ b/sysui/desktop/share/apparmor.sh @@ -37,10 +37,11 @@ INST_ROOT_FORMAT=${INST_ROOT_FORMAT////.} #Need to escape / for sed INST_ROOT_SED=${INST_ROOT////\\/} -for filename in $(ls $PROFILESFROM) +for filename in $PROFILESFROM do tourl=$INSTALLTO$INST_ROOT_FORMAT$filename - sed "s/INSTDIR-/$INST_ROOT_SED/g" $PROFILESFROM$filename > $tourl + sed "s/INSTDIR-/$INST_ROOT_SED/g" "$PROFILESFROM""$filename" > "$tourl" + [[ -e $filename ]] || break echo "$tourl" done |