All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 001/14] howto-index.sh: use the $( ... ) construct for command substitution
@ 2014-04-16 17:29 Elia Pinto
  2014-04-16 17:29 ` [PATCH 002/14] install-webdoc.sh: " Elia Pinto
                   ` (13 more replies)
  0 siblings, 14 replies; 16+ messages in thread
From: Elia Pinto @ 2014-04-16 17:29 UTC (permalink / raw)
  To: git; +Cc: Elia Pinto

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>
---
 Documentation/howto-index.sh |   12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/Documentation/howto-index.sh b/Documentation/howto-index.sh
index a234086..167b363 100755
--- a/Documentation/howto-index.sh
+++ b/Documentation/howto-index.sh
@@ -11,8 +11,8 @@ EOF
 
 for txt
 do
-	title=`expr "$txt" : '.*/\(.*\)\.txt$'`
-	from=`sed -ne '
+	title=$(expr "$txt" : '.*/\(.*\)\.txt$')
+	from=$(sed -ne '
 	/^$/q
 	/^From:[ 	]/{
 		s///
@@ -21,9 +21,9 @@ do
 		s/^/by /
 		p
 	}
-	' "$txt"`
+	' "$txt")
 
-	abstract=`sed -ne '
+	abstract=$(sed -ne '
 	/^Abstract:[ 	]/{
 		s/^[^ 	]*//
 		x
@@ -39,11 +39,11 @@ do
 		x
 		p
 		q
-	}' "$txt"`
+	}' "$txt")
 
 	if grep 'Content-type: text/asciidoc' >/dev/null $txt
 	then
-		file=`expr "$txt" : '\(.*\)\.txt$'`.html
+		file=$(expr "$txt" : '\(.*\)\.txt$').html
 	else
 		file="$txt"
 	fi
-- 
1.7.10.4

^ permalink raw reply related	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2014-04-17 18:25 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-04-16 17:29 [PATCH 001/14] howto-index.sh: use the $( ... ) construct for command substitution Elia Pinto
2014-04-16 17:29 ` [PATCH 002/14] install-webdoc.sh: " Elia Pinto
2014-04-16 17:29 ` [PATCH 003/14] git-checkout.sh: " Elia Pinto
2014-04-16 17:29 ` [PATCH 004/14] git-clone.sh: " Elia Pinto
2014-04-16 17:29 ` [PATCH 005/14] git-commit.sh: " Elia Pinto
2014-04-16 17:29 ` [PATCH 006/14] git-fetch.sh: " Elia Pinto
2014-04-16 17:29 ` [PATCH 007/14] git-ls-remote.sh: " Elia Pinto
2014-04-16 17:29 ` [PATCH 008/14] git-merge.sh: " Elia Pinto
2014-04-16 17:29 ` [PATCH 009/14] git-repack.sh: " Elia Pinto
2014-04-16 17:29 ` [PATCH 010/14] git-resolve.sh: " Elia Pinto
2014-04-16 17:29 ` [PATCH 011/14] git-revert.sh: " Elia Pinto
2014-04-16 17:29 ` [PATCH 012/14] git-tag.sh: " Elia Pinto
2014-04-16 17:29 ` [PATCH 013/14] t9360-mw-to-git-clone.sh: " Elia Pinto
2014-04-16 17:29 ` [PATCH 014/14] t9362-mw-to-git-utf8.sh: " Elia Pinto
2014-04-17  9:00 ` [PATCH 001/14] howto-index.sh: " Matthieu Moy
2014-04-17 18:25   ` Junio C Hamano

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.