diff options
author | Olivier Hallot <olivier.hallot@libreoffice.org> | 2017-09-20 17:09:40 -0300 |
---|---|---|
committer | Olivier Hallot <olivier.hallot@libreoffice.org> | 2017-09-20 22:13:23 +0200 |
commit | 3e535dfe206e106a7a06e39a8e9f5a7b6e5bc95c (patch) | |
tree | c528b00b7b7dda7ddc8bcb379233cd51964ebdad /help3xsl | |
parent | e52676102bf94041c27870a5ae86d7532db637ac (diff) |
Some better coding practice
use $() in bash script
Change-Id: Ia46e529bf2059a378b0f311ec2b6d5fc03e86f66
Reviewed-on: https://gerrit.libreoffice.org/42566
Reviewed-by: Olivier Hallot <olivier.hallot@libreoffice.org>
Tested-by: Olivier Hallot <olivier.hallot@libreoffice.org>
Diffstat (limited to 'help3xsl')
-rwxr-xr-x | help3xsl/xhp2html.sh | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/help3xsl/xhp2html.sh b/help3xsl/xhp2html.sh index 105a860493..9e90a0aa2b 100755 --- a/help3xsl/xhp2html.sh +++ b/help3xsl/xhp2html.sh @@ -35,7 +35,7 @@ function convert2HTML() { xsltparm='--stringparam fileTree '$6' --stringparam local '$5' --stringparam Language '$3' --stringparam productversion '$4' --stringparam root '$1'/' echo 'Conversion to HTML started for '$3 -for filep in `find $1/text -name "*.xhp"` +for filep in $(find $1/text -name "*.xhp") do DIR=${filep##*text/} name=${DIR:0:-3} @@ -49,7 +49,7 @@ done # ########################################### -treePOFile=`mktemp` +treePOFile=$(mktemp) echo $root/translations/source/$3/helpcontent2/source/auxiliary.po > $treePOFile ALL_TREE='sbasic.tree scalc.tree schart.tree shared.tree simpress.tree smath.tree swriter.tree' @@ -65,8 +65,8 @@ xsltparm='--stringparam lang '$3' --stringparam productversion '$4 for tree in $ALL_TREE do treeSourceFile=$root'/helpcontent2/source/auxiliary/'$tree -treeTemp1=`mktemp` -treeTemp2=`mktemp` +treeTemp1=$(mktemp) +treeTemp2=$(mktemp) "${exedir}/treex" -l $3 -i $treeSourceFile -m $treePOFile -o $treeTemp1 -r $xhpFiles @@ -97,8 +97,7 @@ fileTree='/home/tdf/git/core/helpcontent2/help3xsl/html/' rootHelpex=/home/tdf/git/core ALL_LANGS='en-US am ar ast bg bn bn-IN bo bs ca ca-valencia cs da de dz el en-GB en-ZA eo es et eu fi fr gl gu he hi hr hu id is it ja ka km ko lo lt lv mk nb ne nl nn om pl pt-BR pt ro ru sid si sk sl sq sv ta tg tr ug uk vi zh-CN zh-TW' - -here=`pwd` +here=$(pwd) root=$(realpath "$here/../..") rm -rf $here/l10n @@ -192,7 +191,7 @@ xhpfiles=`mktemp` find $translations -type f >$pofiles # For each po file -for ff in `cat $pofiles` +for ff in $(cat $pofiles) do echo 'Processing po file: '$ff potemp=`mktemp` |