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>
This commit is contained in:
Elia Pinto 2015-12-22 16:27:50 +01:00 committed by Junio C Hamano
parent ed6c23142a
commit fc7b076d33

View File

@ -9,9 +9,9 @@ test_description='git mailinfo and git mailsplit test'
test_expect_success 'split sample box' \ test_expect_success 'split sample box' \
'git mailsplit -o. "$TEST_DIRECTORY"/t5100/sample.mbox >last && 'git mailsplit -o. "$TEST_DIRECTORY"/t5100/sample.mbox >last &&
last=`cat last` && last=$(cat last) &&
echo total is $last && echo total is $last &&
test `cat last` = 17' test $(cat last) = 17'
check_mailinfo () { check_mailinfo () {
mail=$1 opt=$2 mail=$1 opt=$2
@ -23,7 +23,7 @@ check_mailinfo () {
} }
for mail in `echo 00*` for mail in $(echo 00*)
do do
test_expect_success "mailinfo $mail" ' test_expect_success "mailinfo $mail" '
check_mailinfo $mail "" && check_mailinfo $mail "" &&
@ -47,11 +47,11 @@ test_expect_success 'split box with rfc2047 samples' \
'mkdir rfc2047 && 'mkdir rfc2047 &&
git mailsplit -orfc2047 "$TEST_DIRECTORY"/t5100/rfc2047-samples.mbox \ git mailsplit -orfc2047 "$TEST_DIRECTORY"/t5100/rfc2047-samples.mbox \
>rfc2047/last && >rfc2047/last &&
last=`cat rfc2047/last` && last=$(cat rfc2047/last) &&
echo total is $last && echo total is $last &&
test `cat rfc2047/last` = 11' test $(cat rfc2047/last) = 11'
for mail in `echo rfc2047/00*` for mail in $(echo rfc2047/00*)
do do
test_expect_success "mailinfo $mail" ' test_expect_success "mailinfo $mail" '
git mailinfo -u $mail-msg $mail-patch <$mail >$mail-info && git mailinfo -u $mail-msg $mail-patch <$mail >$mail-info &&