Skip to content

Commit b09d855

Browse files
devzero2000gitster
authored andcommitted
check-builtins.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]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent d393d14 commit b09d855

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Diff for: check-builtins.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ sort |
1414
bad=0
1515
while read builtin
1616
do
17-
base=`expr "$builtin" : 'git-\(.*\)'`
18-
x=`sed -ne 's/.*{ "'$base'", \(cmd_[^, ]*\).*/'$base' \1/p' git.c`
17+
base=$(expr "$builtin" : 'git-\(.*\)')
18+
x=$(sed -ne 's/.*{ "'$base'", \(cmd_[^, ]*\).*/'$base' \1/p' git.c)
1919
if test -z "$x"
2020
then
2121
echo "$base is builtin but not listed in git.c command list"

0 commit comments

Comments
 (0)