Saturday, May 30, 2020

If Else in KornShell

#!/bin/ksh
#prompt the user to enter an input
print -n "enter the number of children you have :"
read numberofchildren
if ( (( numberofchildren>0 )) &&((numberofchildren<=1)) ); then #the space after the ( and before the ) is important

print "you have one children"
else
print "you have more than one children"

fi

No comments:

Post a Comment