I am running SunOS.
bash-3.00$ uname -a SunOS lvsaishdc3in0001 5.10 Generic_142901-02 i86pc i386 i86pc I need to find Yesterday's date in linux with the proper formatting passed from command prompt. When I tried like this on my shell prompt-
bash-3.00$ date --date='yesterday' '+%Y%m%d' date: illegal option -- date=yesterday usage: date [-u] mmddHHMM[[cc]yy][.SS] date [-u] [+format] date -a [-]sss[.fff] I always get date illegal option, why is it so? Is there anything wrong I am doing?
Update:-
bash-3.00$ date --version date: illegal option -- version usage: date [-u] mmddHHMM[[cc]yy][.SS] date [-u] [+format] date -a [-]sss[.fff]
date --versionsay? (post the results in your question, not in a comment because formatting will get hosed)date, so you're not going to have access to all of the fancy options people are talking about. You can install GNU date for Solaris, or you could write a small Perl/Python/etc script that could do the same thing.