From 801e8041438636f264d8d11aa2b6f088fab3d073 Mon Sep 17 00:00:00 2001 From: Muhammet Kara Date: Wed, 28 Dec 2016 17:43:29 +0300 Subject: 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 Reviewed-by: Michael Stahl --- sysui/desktop/share/apparmor.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'sysui') 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 -- cgit