![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Difference in day-hours-minutes-seconds format | Sreejith_VK | Shell Programming and Scripting | 7 | 02-27-2008 02:04 AM |
| Adding # minutes to current time... | gptavares | UNIX for Advanced & Expert Users | 7 | 06-25-2007 04:10 PM |
| crontab every 2 minutes, 24 hours and once a week | Bobafart | UNIX for Dummies Questions & Answers | 6 | 05-17-2007 11:08 AM |
| Convert minutes to hours, minutes, seconds | Vozx | Shell Programming and Scripting | 1 | 12-09-2005 01:24 AM |
| How can I create a file with current time - 60 minutes | DaveyTN | Shell Programming and Scripting | 4 | 10-05-2005 09:17 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
Reading Hours and Minutes from file and comparing with current
Hi,
Time till when the application should run is indicated in a file. First line is hour and second line is minute. file: 10 55 Means my application should run till 10:55. Now in a shell script, i am trying to make that logic but with no luck. min=`tail -n 1 /file_with_time` hour=`head -n 1 /file_with_time` chour=`date +%H` cmin=`date +%M` if [ $chour < $hour ] <== Shell script throws error here when value is two digits ie if first line the file is > 9. then run_my_app fi if [ $chour = $hour ] then if [ $cmin < $min ] then run_my_app fi fi Kindly suggest. SDG |
![]() |
| Bookmarks |
| Tags |
| read numbers and use in if conditions |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|