Get the last day of the last month in csh?
- by ANE
How do you get the last day of the last month in csh?
Here is the code so far. The cal command below works if you execute it from the (FreeBSD sh) command line, but I'm having trouble escaping it properly to run within a script.
#!/bin/csh
set lastdayoflastmonth=`cal `date '+%m'` `date '+%Y'` | grep . | fmt -1 | tail -1`
echo $lastdayoflastmonth