Month name

Hi,

Could you pls help me out in finding the name of next month.?

For eg:

date +"%b" gives the current month ie 'Jul'
I want to get the output as 'Aug'

Thanks,
Jerry

With coreutils GNU date:

date +%b --date '+1 month'

for cal that supports -3 option

cal -3 |awk 'NR==1{print substr($5,1,3)}'

for systems without GNU date

date "+%b" | awk 'BEGIN{
 m["Jan"]="Feb"
 m["Feb"]="Mar"
 m["Mar"]="Apr"
 m["Apr"]="May"
 m["May"]="Jun"
 m["Jun"]="Jul"
 m["Jul"]="Aug"
 m["Aug"]="Sep"
 m["Sep"]="Oct"
 m["Oct"]="Nov"
 m["Nov"]="Dec"
 m["Dec"]="Jan"
}
{print m[$0]}
'

If you are using ksh93

$ printf "%(%B)T\n" "next month"
August

thanks lots for ur help