Custom Search

Saturday 21 April 2012

Write a Linux shell script for calendar for current month & year also for range of months, Unix program to print the calender


Write a Linux shell script for calendar for current month & year also for range of months, Unix program to print the calender 


Program
clear
cal
echo""
echo""
echo"Enter year"
read y
echo"Enter starting month"
read m1
echo"Enter ending month"
read m2
for ((i=m1;i<=m2;i++))
do
 cal $i$y
done


Output:
Enter year 2009
Enter starting month :2
Enter ending month :3


Note: it will show Feb. 2009 and month 2009 cal.
<<< Previous  ||  Current  ||  Next >>>  

No comments:

Post a Comment

Laptops