Thursday, October 15, 2009

Bash: If and Case

for ((i=0;i<4;i+=1));
do
case $i in
"0" )
echo "${i} : zero"
;;
"1" )
echo "${i} : one"
;;
esac

if [ ${i} -eq "3" ]; then
echo "Here is number : Three "
fi
done

*** Result ***
0 : zero
1 : one
Here is number : Three

-- TaTsHuYa --

No comments: