Skip to content

Commit 0eca37c

Browse files
devzero2000gitster
authored andcommitted
test-gitmw-lib.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 <[email protected]> Reviewed-by: Matthieu Moy <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 9bfeaa0 commit 0eca37c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

contrib/mw-to-git/t/test-gitmw-lib.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ test_diff_directories () {
9090
#
9191
# Check that <dir> contains exactly <N> files
9292
test_contains_N_files () {
93-
if test `ls -- "$1" | wc -l` -ne "$2"; then
93+
if test $(ls -- "$1" | wc -l) -ne "$2"; then
9494
echo "directory $1 should contain $2 files"
9595
echo "it contains these files:"
9696
ls "$1"
@@ -341,10 +341,10 @@ wiki_install () {
341341
"http://download.wikimedia.org/mediawiki/$MW_VERSION_MAJOR/"\
342342
"$MW_FILENAME. "\
343343
"Please fix your connection and launch the script again."
344-
echo "$MW_FILENAME downloaded in `pwd`. "\
344+
echo "$MW_FILENAME downloaded in $(pwd). "\
345345
"You can delete it later if you want."
346346
else
347-
echo "Reusing existing $MW_FILENAME downloaded in `pwd`."
347+
echo "Reusing existing $MW_FILENAME downloaded in $(pwd)."
348348
fi
349349
archive_abs_path=$(pwd)/$MW_FILENAME
350350
cd "$WIKI_DIR_INST/$WIKI_DIR_NAME/" ||

0 commit comments

Comments
 (0)