diff options
author | Yeliz Taneroğlu <yeliztaneroglu@gmail.com> | 2017-05-12 19:15:53 +0300 |
---|---|---|
committer | Chris Sherlock <chris.sherlock79@gmail.com> | 2017-05-20 11:29:44 +0200 |
commit | 020e1bff16a7bb5f401a2547d211807acd7db0fb (patch) | |
tree | d6ed5b5a4d985b2773993ab40320e2588e16f6c3 | |
parent | e20f6464cc4047876ce5e6d47510e8038c513234 (diff) |
tdf#105204: ShellCheck nitpicks for gengal.sh
Use $(STATEMENT) instead of legacy `STATEMENT`.
Double quote to prevent globbing and word splitting.
Double quote array expansions to avoid re-splitting elements.
Change-Id: I7fac5d187597aa37920754ed53be7bcc83603cee
Reviewed-on: https://gerrit.libreoffice.org/37549
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Chris Sherlock <chris.sherlock79@gmail.com>
-rwxr-xr-x | svx/source/gengal/gengal.sh | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/svx/source/gengal/gengal.sh b/svx/source/gengal/gengal.sh index 7535e25b5c6b..8bab14678ff3 100755 --- a/svx/source/gengal/gengal.sh +++ b/svx/source/gengal/gengal.sh @@ -22,19 +22,19 @@ SAL_ENABLE_FILE_LOCKING=1 export SAL_ENABLE_FILE_LOCKING # resolve installation directory -sd_cwd=`pwd` +sd_cwd=$(pwd) sd_res=$0 while [ -h "$sd_res" ] ; do - cd "`dirname "$sd_res"`" - sd_basename=`basename "$sd_res"` - sd_res=`ls -l "$sd_basename" | sed "s/.*$sd_basename -> //g"` + cd "$(dirname "$sd_res")" + sd_basename=$(basename "$sd_res") + sd_res=$(ls -l "$sd_basename" | sed "s/.*$sd_basename -> //g") done -cd "`dirname "$sd_res"`" -sd_prog=`pwd` +cd "$(dirname "$sd_res")" +sd_prog=$(pwd) cd "$sd_cwd" # this is a temporary hack until we can live with the default search paths -case "`uname -s`" in +case "$(uname -s)" in NetBSD|OpenBSD|FreeBSD|DragonFly) LD_LIBRARY_PATH=$sd_prog${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}} JAVA_HOME=$(javaPathHelper -h libreoffice-java 2> /dev/null) @@ -51,7 +51,7 @@ esac #collect all bootstrap variables specified on the command line #so that they can be passed as arguments to javaldx later on -for arg in $@ +for arg in "$@" do case "$arg" in -env:*) BOOTSTRAPVARS=$BOOTSTRAPVARS" ""$arg";; @@ -62,10 +62,10 @@ done # extend the ld_library_path for java: javaldx checks the sofficerc for us if [ -x "$sd_prog/javaldx" ] ; then - my_path=`"$sd_prog/javaldx" $BOOTSTRAPVARS \ - "-env:INIFILENAME=vnd.sun.star.pathname:$sd_prog/redirectrc"` + my_path=$("$sd_prog/javaldx" "$BOOTSTRAPVARS" \ + "-env:INIFILENAME=vnd.sun.star.pathname:$sd_prog/redirectrc") if [ -n "$my_path" ] ; then - sd_platform=`uname -s` + sd_platform=$(uname -s) case $sd_platform in AIX) LIBPATH=$my_path${LIBPATH:+:$LIBPATH} |