![]() |
|
|
grep unix.com with google
|
|||||||
| Forums | Register | Blog | Man Pages | Forum Rules | Links | Albums | FAQ | Our Members | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
![]() |
|
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|||
|
Obtaining day before a given date
Hi all,
is there a way using GNU (Solaris 8) methods of obtaining the day before a given day? i.e. 2007-09-09.... I would like the date a day before it so output would be 2007-09-08. Format YYYY-MM-DD I know I can subtract the day number using cut and expr but it would get tricky if the date was 2007-09-01 for example and would also make my script long with all the permutations of checking months, years etc. |
|
|||
|
Quote:
I get the following: date: illegal option -- d usage: date [-u] mmddHHMM[[cc]yy][.SS] date [-u] [+format] date -a [-]sss[.fff] |
|
||||
|
-d (or --date) is an option that is specific to the GNU version of date.
Seems that you don't use GNU commands. In that case, consult the post Yesterdays Date/Date Arithmetic Jean-Pierre. |
| Sponsored Links | ||
|
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| obtaining a particular day | johnray31 | Shell Programming and Scripting | 2 | 07-26-2006 07:47 AM |
| Obtaining Process information on AIX | StuBob | High Level Programming | 0 | 01-05-2005 07:13 AM |
| Obtaining A Process ID (PID) | 1cuervo | UNIX for Advanced & Expert Users | 7 | 11-05-2001 12:36 AM |
| Obtaining IP address | Raael | IP Networking | 1 | 05-31-2001 02:12 PM |