t/t5100-mailinfo.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 <gitter.spiros@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Elia Pinto committed Dec 22, 2015 at 16:27 UTC fc7b076d33db9886c5cfe8639d9a7e37159606ac
1 file changed +6 -6
t/t5100-mailinfo.sh
+6 -6
@@ -9,9 +9,9 @@ test_description='git mailinfo and git mailsplit test'
9
10 test_expect_success 'split sample box' \
11 'git mailsplit -o. "$TEST_DIRECTORY"/t5100/sample.mbox >last &&
12 - last=`cat last` &&
12 + last=$(cat last) &&
13 echo total is $last &&
14 - test `cat last` = 17'
14 + test $(cat last) = 17'
15
16 check_mailinfo () {
17 mail=$1 opt=$2
@@ -23,7 +23,7 @@ check_mailinfo () {
23 }
24
25
26 -for mail in `echo 00*`
26 +for mail in $(echo 00*)
27 do
28 test_expect_success "mailinfo $mail" '
29 check_mailinfo $mail "" &&
@@ -47,11 +47,11 @@ test_expect_success 'split box with rfc2047 samples' \
47 'mkdir rfc2047 &&
48 git mailsplit -orfc2047 "$TEST_DIRECTORY"/t5100/rfc2047-samples.mbox \
49 >rfc2047/last &&
50 - last=`cat rfc2047/last` &&
50 + last=$(cat rfc2047/last) &&
51 echo total is $last &&
52 - test `cat rfc2047/last` = 11'
52 + test $(cat rfc2047/last) = 11'
53
54 -for mail in `echo rfc2047/00*`
54 +for mail in $(echo rfc2047/00*)
55 do
56 test_expect_success "mailinfo $mail" '
57 git mailinfo -u $mail-msg $mail-patch <$mail >$mail-info &&