install-webdoc.sh: use the $( ... ) construct for command substitution

The Git CodingGuidelines prefer the $(...) construct for command substitution instead of using the backquotes `...`. The backquoted form is the traditional method for command substitution, and is supported by POSIX. However, all but the simplest uses become complicated quickly. In particular, embedded command substitutions and/or the use of double quotes require careful escaping with the backslash character. The patch was generated by: for _f in $(find . -name "*.sh") do sed -i 's@`\(.*\)`@$(\1)@g' ${_f} done and then carefully proof-read. Signed-off-by: Elia Pinto <gitter.spiros@gmail.com> Reviewed-by: Matthieu Moy <Matthieu.Moy@imag.fr> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Elia Pinto committed Apr 16, 2014 at 10:29 UTC 2c4a050bc60bf7a0633aa1460a8538d18df67848
1 file changed +3 -3
Documentation/install-webdoc.sh
+3 -3
@@ -18,17 +18,17 @@ do
18 else
19 echo >&2 "# install $h $T/$h"
20 rm -f "$T/$h"
21 - mkdir -p `dirname "$T/$h"`
21 + mkdir -p $(dirname "$T/$h")
22 cp "$h" "$T/$h"
23 fi
24 done
25 -strip_leading=`echo "$T/" | sed -e 's|.|.|g'`
25 +strip_leading=$(echo "$T/" | sed -e 's|.|.|g')
26 for th in \
27 "$T"/*.html "$T"/*.txt \
28 "$T"/howto/*.txt "$T"/howto/*.html \
29 "$T"/technical/*.txt "$T"/technical/*.html
30 do
31 - h=`expr "$th" : "$strip_leading"'\(.*\)'`
31 + h=$(expr "$th" : "$strip_leading"'\(.*\)')
32 case "$h" in
33 RelNotes-*.txt | index.html) continue ;;
34 esac