LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
Search this Thread
Old 05-18-2007, 07:59 PM   #1
keith.brown
LQ Newbie
 
Registered: Jul 2006
Posts: 1

Rep: Reputation: 0
Bash time of day processing


I need to have a script act depending upon the time of day in response to a real time event. Since this is real time, CRON would not work here.

Here is some psuedo code where I need to replace what is between the [ ] of the 'if' statement.

if [ (current time is between 8:00AM and 5:00PM) ]
then echo "STATEMENT PROCESSED"
else echo "STATEMENT NOT PROCESSED"
fi

# or

if [ (current day is Monday thru Friday) ]
then echo "STATEMENT PROCESSED"
else echo "STATEMENT NOT PROCESSED"
fi


Thanks
 
Old 05-18-2007, 08:06 PM   #2
stress_junkie
Senior Member
 
Registered: Dec 2005
Location: Massachusetts, USA
Distribution: Ubuntu 10.04 and CentOS 5.5
Posts: 3,873

Rep: Reputation: 331Reputation: 331Reputation: 331Reputation: 331
This is an extremely simple problem. It sounds like homework to me.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
bash string processing powah Programming 3 03-14-2007 06:40 AM
how to do batch processing with time out? Franziss Programming 4 11-30-2005 10:17 PM
processing command args in bash slzckboy Programming 10 09-28-2005 04:49 PM
newbe bash question ( grep processing) therealbxp Programming 2 11-20-2004 07:40 AM
how to accurately measure processing time rasselin Programming 3 09-01-2003 11:45 AM


All times are GMT -5. The time now is 06:27 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration