improve if on bash

This commit is contained in:
alexandre medeiros 2013-09-22 11:20:10 -03:00
parent 96055ac7a5
commit e1c34ca138

View File

@ -59,11 +59,12 @@ read NAME # Note that we didn't need to declare new variable
echo Hello, $NAME! echo Hello, $NAME!
# We have the usual if structure: # We have the usual if structure:
if true # use 'man test' for more info about conditionals
if [ $NAME -ne $USER ]
then then
echo "This is expected" echo "Your name is you username"
else else
echo "And this is not" echo "Your name isn't you username"
fi fi
# There is also conditional execution # There is also conditional execution