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 <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 16, 2014 at 10:29 UTC
f25f5e61a7c1a22dd85413d61db639e7c01268f4
1 file changed
+6
-6
Documentation/howto-index.sh
+6
-6
@@ -11,8 +11,8 @@ EOF
11
12
for txt
13
do
14
- title=`expr "$txt" : '.*/\(.*\)\.txt$'`
15
- from=`sed -ne '
14
+ title=$(expr "$txt" : '.*/\(.*\)\.txt$')
15
+ from=$(sed -ne '
16
/^$/q
17
/^From:[ ]/{
18
s///
@@ -21,9 +21,9 @@ do
21
s/^/by /
22
p
23
}
24
- ' "$txt"`
24
+ ' "$txt")
25
26
- abstract=`sed -ne '
26
+ abstract=$(sed -ne '
27
/^Abstract:[ ]/{
28
s/^[^ ]*//
29
x
@@ -39,11 +39,11 @@ do
39
x
40
p
41
q
42
- }' "$txt"`
42
+ }' "$txt")
43
44
if grep 'Content-type: text/asciidoc' >/dev/null $txt
45
then
46
- file=`expr "$txt" : '\(.*\)\.txt$'`.html
46
+ file=$(expr "$txt" : '\(.*\)\.txt$').html
47
else
48
file="$txt"
49
fi