From e1c34ca138cc1a978a85ba5062bed47219ac2d1c Mon Sep 17 00:00:00 2001 From: alexandre medeiros Date: Sun, 22 Sep 2013 11:20:10 -0300 Subject: improve if on bash --- bash.html.markdown | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/bash.html.markdown b/bash.html.markdown index fe17e710..4a290358 100644 --- a/bash.html.markdown +++ b/bash.html.markdown @@ -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 -- cgit v1.2.3