LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
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: 335Reputation: 335Reputation: 335Reputation: 335
This is an extremely simple problem. It sounds like homework to me.
 
  


Reply



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
processing command args in bash slzckboy Programming 16 10-18-2017 03:12 AM
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
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

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 04:07 AM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration