|
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
|