Prog 17. WASS to accept a weekday ( 1 ,2 3 …7) from user using command line and print appropriate day in words ( Monday , Tuesday , Wednesday )
Page 1 of 1
Prog 17. WASS to accept a weekday ( 1 ,2 3 …7) from user using command line and print appropriate day in words ( Monday , Tuesday , Wednesday )
clear
if $# -eq 1
then
case $1 in
1) echo "Monday";;
2) echo "Tuesday";;
3) echo "Wednesday";;
4) echo "Thursday";;
5) echo "Friday";;
6) echo "Saturday";;
7) echo "Sunday";;
esac
else
echo "Wrong Arguements: Are you from earth?"
exit;
if $# -eq 1
then
case $1 in
1) echo "Monday";;
2) echo "Tuesday";;
3) echo "Wednesday";;
4) echo "Thursday";;
5) echo "Friday";;
6) echo "Saturday";;
7) echo "Sunday";;
esac
else
echo "Wrong Arguements: Are you from earth?"
exit;
1987ronnie- Posts : 3
Join date : 2010-07-20
Similar topics
» Prog31. WASS to accept a color name from the user and check whether its equal to BLACK , if so print message as accepted else display not accepted.
» 35. WASS to print your name until the user presses Q or q button
» WASS to accept a string from the user and display number of vowels
» 39. WASS which accept a file name and print last 10 lines of the file
» 5. WASS to print the following series – 1 3 2 4 3 5 4 ….100
» 35. WASS to print your name until the user presses Q or q button
» WASS to accept a string from the user and display number of vowels
» 39. WASS which accept a file name and print last 10 lines of the file
» 5. WASS to print the following series – 1 3 2 4 3 5 4 ….100
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum