how to echo previous month in unix

February 1, 2012 at 21:58:59
Specs: Windows XP
tDate=`date +%m-%d-%Y`

echo "Good Day." > $Dump_dir/body.txt
echo \ >> $Dump_dir/body.txt
echo \ >> $Dump_dir/body.txt
echo "Attached is the Static IP last month." >> $Dump_dir/body.txt
echo \ >> $Dump_dir/body.txt
echo \ >> $Dump_dir/body.txt
echo "Thank you," >> $Dump_dir/body.txt
echo "BAAIS Team" >> $Dump_dir/body.txt
echo \ >> $Dump_dir/body.txt
echo "**** Please do not reply to this email as this is an auto-generated email.****" >> $Dump_dir/body.txt

I want to change the "last month" with the actual month.


See More: how to echo previous month in unix

Report •

#1
February 2, 2012 at 10:53:38
echo `date --date="last month" +%m-%d-%Y`

Report •
Related Solutions


Ask Question