Skip to content

Commit 9e5878f

Browse files
devzero2000gitster
authored andcommitted
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 <[email protected]> Reviewed-by: Matthieu Moy <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent d0ea45b commit 9e5878f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

git-web--browse.sh

+3-3
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ do
5959
-b|--browser*|-t|--tool*)
6060
case "$#,$1" in
6161
*,*=*)
62-
browser=`expr "z$1" : 'z-[^=]*=\(.*\)'`
62+
browser=$(expr "z$1" : 'z-[^=]*=\(.*\)')
6363
;;
6464
1,*)
6565
usage ;;
@@ -71,7 +71,7 @@ do
7171
-c|--config*)
7272
case "$#,$1" in
7373
*,*=*)
74-
conf=`expr "z$1" : 'z-[^=]*=\(.*\)'`
74+
conf=$(expr "z$1" : 'z-[^=]*=\(.*\)')
7575
;;
7676
1,*)
7777
usage ;;
@@ -100,7 +100,7 @@ then
100100
for opt in "$conf" "web.browser"
101101
do
102102
test -z "$opt" && continue
103-
browser="`git config $opt`"
103+
browser="$(git config $opt)"
104104
test -z "$browser" || break
105105
done
106106
if test -n "$browser" && ! valid_tool "$browser"; then

0 commit comments

Comments
 (0)