t3910-mac-os-precompose.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 <gitter.spiros@gmail.com> Reviewed-by: Matthieu Moy <Matthieu.Moy@imag.fr> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Elia Pinto committed Apr 30, 2014 at 09:22 UTC a4cf6b4b91835c1d8d13ebb5cf3ce9241e181f1b
1 file changed +8 -8
t/t3910-mac-os-precompose.sh
+8 -8
@@ -14,13 +14,13 @@ then
14 fi
15
16 # create utf-8 variables
17 -Adiarnfc=`printf '\303\204'`
18 -Adiarnfd=`printf 'A\314\210'`
17 +Adiarnfc=$(printf '\303\204')
18 +Adiarnfd=$(printf 'A\314\210')
19
20 -Odiarnfc=`printf '\303\226'`
21 -Odiarnfd=`printf 'O\314\210'`
22 -AEligatu=`printf '\303\206'`
23 -Invalidu=`printf '\303\377'`
20 +Odiarnfc=$(printf '\303\226')
21 +Odiarnfd=$(printf 'O\314\210')
22 +AEligatu=$(printf '\303\206')
23 +Invalidu=$(printf '\303\377')
24
25
26 #Create a string with 255 bytes (decomposed)
@@ -35,7 +35,7 @@ Alongc=$Alongc$Alongc$Alongc$Alongc$Alongc #250 Byte
35 Alongc=$Alongc$AEligatu$AEligatu #254 Byte
36
37 test_expect_success "detect if nfd needed" '
38 - precomposeunicode=`git config core.precomposeunicode` &&
38 + precomposeunicode=$(git config core.precomposeunicode) &&
39 test "$precomposeunicode" = true &&
40 git config core.precomposeunicode true
41 '
@@ -146,7 +146,7 @@ test_expect_success "respect git config --global core.precomposeunicode" '
146 git config --global core.precomposeunicode true &&
147 rm -rf .git &&
148 git init &&
149 - precomposeunicode=`git config core.precomposeunicode` &&
149 + precomposeunicode=$(git config core.precomposeunicode) &&
150 test "$precomposeunicode" = "true"
151 '
152