script gives last day of the month with awk 3.1.3 but with awk 3.1.5 LAST_DAY is MT?
#!/bin/ksh
LAST_DAY=`cal | awk '{
if ( length($0) > 0 )
{
end_of_month=$0
}
}
END {
printf "%s\n",substr(end_of_month,length(end_of_month) -1 )
}'`
echo $LAST_DAY
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.