|
2011-08-21
, 19:55
|
Posts: 1,751 |
Thanked: 844 times |
Joined on Feb 2010
@ Sweden
|
#2
|
|
2011-08-21
, 20:24
|
Posts: 237 |
Thanked: 274 times |
Joined on Jul 2010
|
#3
|
The Following User Says Thank You to ivyking For This Useful Post: | ||
|
2011-08-22
, 07:54
|
Posts: 669 |
Thanked: 433 times |
Joined on May 2010
|
#4
|
|
2011-08-25
, 20:45
|
Posts: 47 |
Thanked: 31 times |
Joined on Jul 2010
|
#5
|
alarmd is not an option - the trigger for this script is dbus event - i do not want it to run in certain hour (if i did - i would know what time it is running).
I will definitely need help in making such a command in shell script (format the strings of course) since i am very weak at this:
the .sh script will be something like this is pseudo code:
if [ time is between 16:00 to 18:00 ]; then
[run the command]
fi
Thanks!
hr=`date +%H` if test $hr -ge 16 -a $hr -lt 18 then # do something here fi
The Following 2 Users Say Thank You to ZedThou For This Useful Post: | ||
|
2011-08-25
, 21:15
|
|
Posts: 738 |
Thanked: 983 times |
Joined on Apr 2010
@ London
|
#6
|
The Following User Says Thank You to erendorn For This Useful Post: | ||
|
2011-08-26
, 09:46
|
Posts: 669 |
Thanked: 433 times |
Joined on May 2010
|
#7
|
Code:hr=`date +%H` if test $hr -ge 16 -a $hr -lt 18 then # do something here fi
|
2011-08-26
, 11:31
|
Posts: 10 |
Thanked: 29 times |
Joined on Jun 2010
@ Germany
|
#8
|
Thanks - works great, but how can i add support for an exact hour with minutes - something like between 16:30 - 18:30?
Is there a place where it is explained how to manipulate this data?
hr=`date +%H%M`
if test $hr -ge 1630 -a $hr -lt 1830
The Following User Says Thank You to Obsidian For This Useful Post: | ||
|
2011-08-26
, 13:58
|
Posts: 669 |
Thanked: 433 times |
Joined on May 2010
|
#9
|
the script will be run by an event from the phone, but the command itself must not run if the time of day is not between this time frame.
Thanks.