0% found this document useful (0 votes)
11 views2 pages

Caseselect Unix

Uploaded by

dgpguru
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views2 pages

Caseselect Unix

Uploaded by

dgpguru
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 2

1.

echo "Enter number:"


read num

case $num in
1)
echo "It's one!"
;;

2)
echo "It's two!"
;;

3)
echo "It's three!"
;;

4)
echo "It's something else!"
;;
esac

echo "End of script."

2.
echo "Enter your name:"
read name

echo "Enter time of the day [Morning/Afternoon/Evening/Night]:"


read daytime

case $daytime in
"Morning")
echo "Good Morning $name"
;;

"Afternoon")
echo "Good Afternoon $name"
;;

"Evening")
echo "Good Evening $name"
;;

"Night")
echo "Good Night $name"
;;
esac

echo "End of script."

wap to print calculator program by switch case


1 add
2 sub
3 mul
4 div
else
wrong no
wap to print 1 1st floor 2 2nd floor 3 erd floor else wrong choice

You might also like