|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Stay one step ahead of the competition. Evaluate and give feedback
on some of the hottest web development tools on the market today.
Make your opinion heard! Click
Here
|
|
#1
|
|||
|
|||
|
Help - Unix Scripting
Hi! could anyone help me?
I'm new in unix scripting, it seems that my script is not working, what I intend to do is send an e-mail to two different mail account depending on what time this script was run. The script always send mail on the mcthalla@yahoo.com even if the time is beyond 7pm. Here's my script start_time=`date '+%H%M%S'` print "IQ message count of $SAVE_IQ exceeded the 3K threshold." >> $IQ_COUNT_ALERT if [ $start_time -ge 70000 ] and [ $start_time -le 190000 ] then mail -s "IQ Count Alert!" mcthalla@yahoo.com<$IQ_COUNT_ALERT else mail -s "IQ Count Alert!" tmureta@yahoo.com<$IQ_COUNT_ALERT fi runtime of the script was 214636, if this is the time, a mail should be sent to my tmureta@yahoo.com account (stctst):/exchange/stc/ebill/scripts #./start_iq_count_messages.ksh [YOU HAVE NEW MAIL] time:214636 thanks, mayette |
|
#2
|
|||
|
|||
|
Incredibly, ksh seems to accept your syntax without complaint. However it behaves as if the "and [ $start_time -le 190000 ]" was not present. Using the single bracket if, the syntax is:
if [ $start_time -ge 70000 -a $start_time -le 190000 ] |
|
#3
|
|||
|
|||
|
i don't like 'if' (as it's not needed)
SENDTO=mcthalla [ $start_time -ge 70000 -a $start_time -le 190000 ] && SENDTO=tmureta mail -s "IQ Count Alert!" ${SENDTO}@yahoo.com<$IQ_COUNT_ALERT |
![]() |
| Viewing: Dev Shed Forums > Operating Systems > UNIX Help > Help - Unix Scripting |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|