![]() |
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 |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Need suggestions about a datecheck script | tsmurray | Shell Programming and Scripting | 5 | 05-14-2008 11:23 AM |
| Need help for automating a task. How to proceed ?. | aarora_98 | Shell Programming and Scripting | 1 | 01-25-2007 06:04 AM |
| I am porting Dll from NT to Unix, how should I proceed | Vipin | High Level Programming | 3 | 09-18-2001 12:03 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
How can i proceed on this (datecheck)
Hi,
I want to bundle if statements The script which i created is if [[ $(date +'%H') -lt 12 ]]; then if [[ $(date '+%a') = Sat ]]; then now=`TZ=CST+24 date +%Y-%m-%d` nows=`TZ=CST+24 date +%Y-%m-%d` ; else [[ $(date '+%a') = Sun ]]; then now=`TZ=CST+48 date +%Y-%m-%d` nows=`TZ=CST+48 date +%Y-%m-%d` ; fi now=`TZ=CST+24 date +%Y-%m-%d` nows=`date +%Y-%m-%e` echo $now echo $nows ; fi If the time is less than 12 then i want to assign yesterdays date to start_date and todays date to to_date. If the day is saturday or sunday then I am assigning Friday dates to both start_date and end_date When i tried this, i am getting error messges. Can I use If statement like this ? let me know. Thanks in advance cheers, gops |
|
||||
|
Hi Bhargav,
Thanx for your prompt reply with code. I want the second set of statement to be executed if it other than saturday or sunday. If it is saturday or sunday only statement bundled inside the inner if should be executed. Meantime I will try with your code and let me know the updates once you stepped in. cheers, gops |
| Sponsored Links | ||
|
|