diff options
author | Etan Reisner <deryni@unreliablesource.net> | 2015-04-26 13:32:41 -0400 |
---|---|---|
committer | Etan Reisner <deryni@unreliablesource.net> | 2015-04-26 13:32:41 -0400 |
commit | e2ca2c9550474ca3dad0f7ef8735e614da081258 (patch) | |
tree | cde57a184fa15485b682a51a297a7e7a009b6b01 | |
parent | 9d3462953604d0d331191bb1fca82295e1ece6ed (diff) |
Add another very common shell variable assignment mistake.
-rw-r--r-- | bash.html.markdown | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/bash.html.markdown b/bash.html.markdown index b9cd53ff..77ee37f6 100644 --- a/bash.html.markdown +++ b/bash.html.markdown @@ -37,7 +37,14 @@ VARIABLE="Some string" # But not like this: VARIABLE = "Some string" # Bash will decide that VARIABLE is a command it must execute and give an error -# because it couldn't be found. +# because it can't be found. + +# Or like this: +Variable= 'Some string' +# Bash will decide that 'Some string' is a command it must execute and give an +# error because it can't be found. (In this case the 'Variable=' part is seen +# as a variable assignment valid only for the scope of the 'Some string' +# command.) # Using the variable: echo $VARIABLE |