I am looking to get previous date in unix / shell script .
I am using the following code
date -d ’1 day ago’ +’%Y/%m/%d’
But I am getting the following error.
date: illegal option -- d
As far as I've read on the inetrnet , it basically means I am using a older version of GNU. Can anyone please help with this.
Further Info
unix> uname -a
SunOS Server 5.10 Generic_147440-19 sun4v sparc SUNW,Sun-Fire-T200
Also The below command gives an error.
unix> date --version
date: illegal option -- version usage: date [-u] mmddHHMM[[cc]yy][.SS] date [-u] [+format] date -a [-]sss[.fff]
date -doption. Consider editing your question to include the output ofuname -aanddate --version. Good luck.SunOS 5.10 Generic_147440-19 sun4v sparc SUNW,Sun-Fire-T200System = SunOSgdate(GNU date) installed.ksh: gdate: not found