Kaydet (Commit) 801e8041 authored tarafından Muhammet Kara's avatar Muhammet Kara Kaydeden (comit) Michael Stahl

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/32473Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarMichael Stahl <mstahl@redhat.com>
üst 9389f7bc
...@@ -34,7 +34,7 @@ die() ...@@ -34,7 +34,7 @@ die()
get_config_sha() get_config_sha()
{ {
pushd ${SRCDIR?} > /dev/null pushd ${SRCDIR?} > /dev/null
cat ${BUILDDIR?}/config_host.mk | git hash-object --stdin git hash-object ${BUILDDIR?}/config_host.mk
popd > /dev/null popd > /dev/null
} }
......
...@@ -37,10 +37,10 @@ INST_ROOT_FORMAT=${INST_ROOT_FORMAT////.} ...@@ -37,10 +37,10 @@ INST_ROOT_FORMAT=${INST_ROOT_FORMAT////.}
#Need to escape / for sed #Need to escape / for sed
INST_ROOT_SED=${INST_ROOT////\\/} INST_ROOT_SED=${INST_ROOT////\\/}
for filename in `ls $PROFILESFROM` for filename in $(ls $PROFILESFROM)
do do
tourl=$INSTALLTO$INST_ROOT_FORMAT$filename 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" echo "$tourl"
done done
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment