[PATCH 03/14] t7900-subtree.sh: use the $( ... ) construct for command substitution
- From
Elia Pinto <gitter.spiros@gmail.com>
- Date
- Apr 23, 2014, 13:43 UTC
- Message-ID
- <1398260646-2660-3-git-send-email-gitter.spiros@gmail.com>
- In-Reply-To
- <1398260646-2660-1-git-send-email-gitter.spiros@gmail.com>
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}
doneand then carefully proof-read.
Signed-off-by: Elia Pinto <gitter.spiros@gmail.com> --- contrib/subtree/t/t7900-subtree.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/contrib/subtree/t/t7900-subtree.sh b/contrib/subtree/t/t7900-subtree.sh index 66ce4b0..b22b710 100755 --- a/contrib/subtree/t/t7900-subtree.sh +++ b/contrib/subtree/t/t7900-subtree.sh @@ -76,7 +76,7 @@ test_expect_success 'add sub1' ' # Save this hash for testing later. -subdir_hash=`git rev-parse HEAD` +subdir_hash=$(git rev-parse HEAD) test_expect_success 'add sub2' ' create sub2 &&
-- 1.7.10.4