customize cal command
I want to customize cal command so that it accepts more than one month, like $./cal.sh cal 1 3.[January,March]
I have done this for two months,but cannot generalize for more than two months, e.g. cal 1 3 4 or any number of arguments not decided beforehand.
My code:
#!/bin/bash
if [ $# -gt 1 ];then
t=$( 'date' '+20%y' )
if [ $2 -ge 1 -a $2 -le 12 -a $3 -ge 1 -a $3 -le 12 ]
then
cal $2 $t; cal $3 $t
fi
fi
Thanks in advance....
|