Thursday, February 8, 2007

Writing Case - Shell Begineer

This is for them, who are very new to Shell Prog, just an example to see the use of case, hope this helps :-)

#To find the day

day=`date| awk '{print $1}'`

case $1 in
Sun) echo "Sunday";;
Mon) echo "Monday";;
Tue) echo "Tuesday";;
Wed) echo "Wednessday";;
Thu) echo "Thursday";;
Fri) echo "Friday";;
Sat) echo "Saturday";;
*) echo "Not Estimated";;

echo "Today is "`modify $day

No comments:

© Jadu Saikia