The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #1 (permalink)  
Old 12-03-2008
smintz smintz is offline
Registered User
  
 

Join Date: Jun 2006
Posts: 4
help with "if" statement for TIME

This should be incredibly simple, but can't get it to work.
All I want to do is pause a script between 11:00 am and noon.

I receive the following error:
time.sh[4]: 13:55:45: syntax error

script:
1 while true
2 do
3 TIME=$(date '+%H:%M:%S')
4 if [ $TIME -ge 11:00:00 ] -a [ $TIME -le 12:00:00 ]
5 then
6 echo "time between 11:00 and noon"
7 echo sleep time $TIME
8 sleep 3
9 else
10 echo "time all others"
11 fi
12 done