Ksh Tutorials :if else Branching

Ksh Tutorials :if else Branching
if then fi
if [[ $value -eq 7 ]];then
print "$value is 7"
fi
or:
if [[ $value -eq 7 ]]
then
print "$value is 7"
fi
or:
if [[ $value -eq 7 ]];then print "$value is 7";fi
if then else fi
if [[ $name = "John" ]];then
print "Your welcome, ${name}."
else
print "Good bye, ${name}!"
fi
if then elif then else fi
if [[ $name = "John" ]];then
print "Your welcome, ${name}."
elif [[ $name = "Hanna" ]];then
print "Hello, ${name}, who are you?"
else
print "Good bye, ${name}!"
fi
Case esac
case $var in
john
fred) print $invitation;;
martin) print $declination;;
*) print "Wrong name...";;
esac

No comments:

 
Top Blogs