Skip to content

Commit 21c6f98

Browse files
devzero2000gitster
authored andcommitted
test-sha1.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 perl -i -pe 'BEGIN{undef $/;} s/`(.+?)`/\$(\1)/smg' "${_f}" done and then carefully proof-read. Signed-off-by: Elia Pinto <[email protected]> Reviewed-by: Jonathan Nieder <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent e429dfd commit 21c6f98

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

test-sha1.sh

+4-4
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@ dd if=/dev/zero bs=1048576 count=100 2>/dev/null |
66
while read expect cnt pfx
77
do
88
case "$expect" in '#'*) continue ;; esac
9-
actual=`
9+
actual=$(
1010
{
1111
test -z "$pfx" || echo "$pfx"
1212
dd if=/dev/zero bs=1048576 count=$cnt 2>/dev/null |
1313
perl -pe 'y/\000/g/'
1414
} | ./test-sha1 $cnt
15-
`
15+
)
1616
if test "$expect" = "$actual"
1717
then
1818
echo "OK: $expect $cnt $pfx"
@@ -51,14 +51,14 @@ exit
5151

5252
while read cnt pfx
5353
do
54-
actual=`
54+
actual=$(
5555
{
5656
test -z "$pfx" || echo "$pfx"
5757
dd if=/dev/zero bs=1048576 count=$cnt 2>/dev/null |
5858
perl -pe 'y/\000/g/'
5959
} | sha1sum |
6060
sed -e 's/ .*//'
61-
`
61+
)
6262
echo "$actual $cnt $pfx"
6363
done <<EOF
6464
0

0 commit comments

Comments
 (0)