![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | 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. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| File disk utilization for 10 days prior | videsh77 | UNIX for Advanced & Expert Users | 2 | 04-27-2009 09:56 AM |
| Delete lines prior to a specific date in a log file. | ahSher | Shell Programming and Scripting | 4 | 04-06-2009 05:19 AM |
| Identifying prior date in shell script | royalibrahim | Shell Programming and Scripting | 5 | 12-04-2008 09:38 AM |
| retrieve the file. | rajesh08 | UNIX for Advanced & Expert Users | 1 | 10-08-2008 08:56 AM |
| A script pls( To retrieve database information) | rollthecoin | Shell Programming and Scripting | 3 | 04-26-2008 04:35 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
Quote:
Possible solutions include perl, ksh93, GNU date command, GNU awk. GNU date: Code:
last_sunday_yyyymmdd=$(date -d "-$(date +%w) days" +%Y%m%d) day_of_run=20090523 prior_sunday_yyyymmdd=$(date -d "$day_of_run -$(date -d $day_of_run +%w) days" +%Y%m%d) Code:
last_sunday_yyyymmdd=$(awk 'BEGIN{print strftime("%Y%m%d",systime()-86400*strftime("%w",systime()))}')
Last edited by colemar; 05-26-2009 at 05:48 PM.. |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|