git-web--browse.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 23, 2014 at 06:44 UTC 9e5878fbede57c0499133adf73844261849cd7b2
1 file changed +3 -3
git-web--browse.sh
+3 -3
@@ -59,7 +59,7 @@ do
59 -b|--browser*|-t|--tool*)
60 case "$#,$1" in
61 *,*=*)
62 - browser=`expr "z$1" : 'z-[^=]*=\(.*\)'`
62 + browser=$(expr "z$1" : 'z-[^=]*=\(.*\)')
63 ;;
64 1,*)
65 usage ;;
@@ -71,7 +71,7 @@ do
71 -c|--config*)
72 case "$#,$1" in
73 *,*=*)
74 - conf=`expr "z$1" : 'z-[^=]*=\(.*\)'`
74 + conf=$(expr "z$1" : 'z-[^=]*=\(.*\)')
75 ;;
76 1,*)
77 usage ;;
@@ -100,7 +100,7 @@ then
100 for opt in "$conf" "web.browser"
101 do
102 test -z "$opt" && continue
103 - browser="`git config $opt`"
103 + browser="$(git config $opt)"
104 test -z "$browser" || break
105 done
106 if test -n "$browser" && ! valid_tool "$browser"; then