Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
CodingGuidelines: give an example for redirection
author
Junio C Hamano
<gitster@pobox.com>
Wed, 30 Apr 2014 21:24:24 +0000
(14:24 -0700)
committer
Junio C Hamano
<gitster@pobox.com>
Fri, 2 May 2014 20:24:57 +0000
(13:24 -0700)
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Documentation/CodingGuidelines
patch
|
blob
|
history
raw
|
patch
| inline |
side by side
(parent:
79fc3ca
)
diff --git
a/Documentation/CodingGuidelines
b/Documentation/CodingGuidelines
index 169b4358c93a8406a7fff10de3529e95cf6b7018..11704fb84cb3b9652223ad17631c999bafc268d8 100644
(file)
--- a/
Documentation/CodingGuidelines
+++ b/
Documentation/CodingGuidelines
@@
-61,6
+61,14
@@
For shell scripts specifically (not exhaustive):
redirection target in a variable (as shown above), our code does so
because some versions of bash issue a warning without the quotes.
+ (incorrect)
+ cat hello > world < universe
+ echo hello >$world
+
+ (correct)
+ cat hello >world <universe
+ echo hello >"$world"
+
- We prefer $( ... ) for command substitution; unlike ``, it
properly nests. It should have been the way Bourne spelled
it from day one, but unfortunately isn't.