summaryrefslogtreecommitdiffhomepage
path: root/bash.html.markdown
diff options
context:
space:
mode:
authorHunter Stevens <onebree@gmail.com>2016-02-15 17:47:35 -0500
committerHunter Stevens <onebree@gmail.com>2016-02-15 17:47:35 -0500
commitd0b067b140d3d351ae9dee0b3e542935b7ca35d4 (patch)
treeb83501b5b82240663029d7382f873fb369ea81c7 /bash.html.markdown
parentcffb7e6770b517a620115b3a9e1f82ca1dd82a98 (diff)
parentcd16626c8f64a29d8235bd0ab21c7a32e248928f (diff)
Resolve conflicts from merge
Diffstat (limited to 'bash.html.markdown')
-rw-r--r--bash.html.markdown8
1 files changed, 4 insertions, 4 deletions
diff --git a/bash.html.markdown b/bash.html.markdown
index 211d2944..bd2d5984 100644
--- a/bash.html.markdown
+++ b/bash.html.markdown
@@ -83,7 +83,7 @@ echo Hello, $Name!
# We have the usual if structure:
# use 'man test' for more info about conditionals
-if [ $Name -ne $USER ]
+if [ $Name != $USER ]
then
echo "Your name isn't your username"
else
@@ -91,12 +91,12 @@ else
fi
# NOTE: if $Name is empty, bash sees the above condition as:
-if [ -ne $USER ]
+if [ != $USER ]
# which is invalid syntax
# so the "safe" way to use potentially empty variables in bash is:
-if [ "$Name" -ne $USER ] ...
+if [ "$Name" != $USER ] ...
# which, when $Name is empty, is seen by bash as:
-if [ "" -ne $USER ] ...
+if [ "" != $USER ] ...
# which works as expected
# There is also conditional execution