Operating System - HP-UX
1745786 Members
3674 Online
108722 Solutions
New Discussion

Need help in Shell scripting

 
SOLVED
Go to solution
Arturo Galbiati
Esteemed Contributor

Re: Need help in Shell scripting

hi,
I'msorry i wrong type the first line of teh script: user instead of usr.
I improved a script a bit as well removing teh TEMP variable.

#/usr/bin/ksh
MM=${1:-$(date +%m)}
YYYY=${2:-$(date +%Y)}
DAYS=$(cal $MM $YYYY|awk 'END {print $NF}')
echo "$MM $YYYY has $DAYS"
#eof

HTH,
Art
Whitehorse_1
Frequent Advisor

Re: Need help in Shell scripting

Hi Joel,

Thanks, exactly what I was looking for...

Thx, Cem and Arturo...

Assigned points too.. :-), WH
Reading is a good course medicine for deep sleep !!