Xedrox
1
Hello, i need calculate the day before in this format aammdd, for example if i have 110701 i need a script to return the value 110630.
I only know what with this comand "date %y%m%d" return the date system.
Sorry for my english, it is very bad, i know...
Thank you very much
Grettings!
If you have gnu date, then try this
date -d "yesterday" %y%m%d
---------- Post updated at 09:05 AM ---------- Previous update was at 09:04 AM ----------
Or using perl
mydate=$(perl -e '@T=localtime(time-86400);printf("%02d%02d%02d",($T[5]+1900)%100,$T[4]+1,$T[3])' )
echo $mydate