Skip to content
This repository was archived by the owner on Nov 9, 2017. It is now read-only.

Commit f25f5e6

Browse files
devzero2000gitster
authored andcommitted
howto-index.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 75ee3d7 commit f25f5e6

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

Documentation/howto-index.sh

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ EOF
1111

1212
for txt
1313
do
14-
title=`expr "$txt" : '.*/\(.*\)\.txt$'`
15-
from=`sed -ne '
14+
title=$(expr "$txt" : '.*/\(.*\)\.txt$')
15+
from=$(sed -ne '
1616
/^$/q
1717
/^From:[ ]/{
1818
s///
@@ -21,9 +21,9 @@ do
2121
s/^/by /
2222
p
2323
}
24-
' "$txt"`
24+
' "$txt")
2525

26-
abstract=`sed -ne '
26+
abstract=$(sed -ne '
2727
/^Abstract:[ ]/{
2828
s/^[^ ]*//
2929
x
@@ -39,11 +39,11 @@ do
3939
x
4040
p
4141
q
42-
}' "$txt"`
42+
}' "$txt")
4343

4444
if grep 'Content-type: text/asciidoc' >/dev/null $txt
4545
then
46-
file=`expr "$txt" : '\(.*\)\.txt$'`.html
46+
file=$(expr "$txt" : '\(.*\)\.txt$').html
4747
else
4848
file="$txt"
4949
fi

0 commit comments

Comments
 (0)