mirror of
https://github.com/adambard/learnxinyminutes-docs.git
synced 2025-05-05 06:18:32 +00:00
improve if on bash
This commit is contained in:
parent
96055ac7a5
commit
e1c34ca138
@ -59,11 +59,12 @@ read NAME # Note that we didn't need to declare new variable
|
||||
echo Hello, $NAME!
|
||||
|
||||
# We have the usual if structure:
|
||||
if true
|
||||
# use 'man test' for more info about conditionals
|
||||
if [ $NAME -ne $USER ]
|
||||
then
|
||||
echo "This is expected"
|
||||
echo "Your name is you username"
|
||||
else
|
||||
echo "And this is not"
|
||||
echo "Your name isn't you username"
|
||||
fi
|
||||
|
||||
# There is also conditional execution
|
||||
|
Loading…
Reference in New Issue
Block a user