Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Scripting help

Status
Not open for further replies.

sraj142

Technical User
Oct 25, 2006
49
IN
Hi All,
I have tried the following simple script...

#!/bin/csh
set time=`date +"%H%M"`
if ($time >= 0700) then
echo $time"INTIME"
#!/bin/csh
set time=`date +"%H%M"`
if ($?time >= 0700) then
echo $time"INTIME"
else
echo $time"OUTTIME"
endif

It is showing "OUTTIME" everytime. Currently the system time i.e. $time is 0933, but it is not showing "INTIME".
Can anybody help me please ???

Regards - Sraj
 
The following works for me:
Code:
#!/bin/csh
set time=`date +"%H%M"`
if ($time >= 0700) then
  echo $time"INTIME"
else
  echo $time"OUTTIME"
endif

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top