The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
Google UNIX.COM



View Single Post in UNIX Forums - Click on the Thread or Permalink to View Entire Thread -->
  #1 (permalink)  
Old 06-24-2005
gopskrish gopskrish is offline
Registered User
 

Join Date: Jun 2005
Posts: 26
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
Reply With Quote
Forum Sponsor