Skip to content

Commit 4ff0334

Browse files
devzero2000gitster
authored andcommitted
t4013-diff-various.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 e6ce6f4 commit 4ff0334

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

t/t4013-diff-various.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -107,14 +107,14 @@ test_expect_success setup '
107107
+*++ [initial] Initial
108108
EOF
109109

110-
V=`git version | sed -e 's/^git version //' -e 's/\./\\./g'`
110+
V=$(git version | sed -e 's/^git version //' -e 's/\./\\./g')
111111
while read cmd
112112
do
113113
case "$cmd" in
114114
'' | '#'*) continue ;;
115115
esac
116-
test=`echo "$cmd" | sed -e 's|[/ ][/ ]*|_|g'`
117-
pfx=`printf "%04d" $test_count`
116+
test=$(echo "$cmd" | sed -e 's|[/ ][/ ]*|_|g')
117+
pfx=$(printf "%04d" $test_count)
118118
expect="$TEST_DIRECTORY/t4013/diff.$test"
119119
actual="$pfx-diff.$test"
120120

0 commit comments

Comments
 (0)