summaryrefslogtreecommitdiff
path: root/sysui
diff options
context:
space:
mode:
authorMuhammet Kara <muhammet.kara@pardus.org.tr>2016-12-28 17:43:29 +0300
committerMichael Stahl <mstahl@redhat.com>2017-01-04 15:42:08 +0000
commit801e8041438636f264d8d11aa2b6f088fab3d073 (patch)
treedf828dae14729761646479710798b46c00c20212 /sysui
parent9389f7bc1c78231cea0921646c10ff5cdb5a257e (diff)
Remove useless cat, and replace backtick
cat is a tool for con"cat"enating files. Reading a single file as input to a program is considered a Useless Use Of Cat (UUOC). It's more efficient and less roundabout to simply give file as input. Also use $(..) instead of legacy `..` Backtick command substitution `..` is legacy syntax with several issues. It has a series of undefined behaviors related to quoting in POSIX. It imposes a custom escaping mode with surprising results. It's exceptionally hard to nest. $(..) command substitution has none of these problems, and is therefore strongly encouraged. Change-Id: Ia668c6323660641bbb5084ee824ae9ae7631c76f Reviewed-on: https://gerrit.libreoffice.org/32473 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Stahl <mstahl@redhat.com>
Diffstat (limited to 'sysui')
-rwxr-xr-xsysui/desktop/share/apparmor.sh4
1 files changed, 2 insertions, 2 deletions
diff --git a/sysui/desktop/share/apparmor.sh b/sysui/desktop/share/apparmor.sh
index 4a91310b1a29..59803e1ae4db 100755
--- a/sysui/desktop/share/apparmor.sh
+++ b/sysui/desktop/share/apparmor.sh
@@ -37,10 +37,10 @@ INST_ROOT_FORMAT=${INST_ROOT_FORMAT////.}
#Need to escape / for sed
INST_ROOT_SED=${INST_ROOT////\\/}
-for filename in `ls $PROFILESFROM`
+for filename in $(ls $PROFILESFROM)
do
tourl=$INSTALLTO$INST_ROOT_FORMAT$filename
- cat $PROFILESFROM$filename | sed "s/INSTDIR-/$INST_ROOT_SED/g" > $tourl
+ sed "s/INSTDIR-/$INST_ROOT_SED/g" $PROFILESFROM$filename > $tourl
echo "$tourl"
done