case

$ cat casescr
read -p "Enter your fruit"  fruit
case $fruit in
banana) echo "$fruit is yellow";;
apple) echo "$fruit is green";;
esac

$ bash casescr
Enter your fruitbanana
banana is yellow

Comments

Popular posts from this blog

HAproxy logging

teamcity Automatic Agent Start under Linux

15 managing disk - understanding /etc/fstab xfs_admin mount -o rw,remount /