Unix/Linux
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
Go Back   Web Development Archives FAQs Unix/Linux

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Web Development Archives Sponsor:
  #1  
Old June 30th, 2008, 01:49 PM
BN
Guest
Dev Archives Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
ksh 88 (( expression1 ? expression2 : expression 3 )) - HelpPlease

Greetings,

Version 11/16/88

S: HP-UX 11.11, AIX 5.3.0.0, SUN S

Goal is to Page Primary during Mon to Fri between 9 and 5 PM, if not
page on-call.

Time check works fine, one liner doesn't work:

TIME=$(date +%H)

case $TIME in
01|02|03|04|05|06|07|18|19|20|21|22|23|
00)DBA_PAGER="$N_CALL_PAGER" ;;
08|09|10|11|12|13|14|15|16|17)DBA_PAGER=$PRIAMRY_P AGER ;;
esac

DNUM=$(date +%u) # Day Number

(( (DNUM < 6) ? PAGE="N_CALL" : PAGE="PRIMARY" ))

ksh: (DNUM < 6) ? PAGE=N_CALL : PAGE=PRIMARY : syntax error

Not sure what am I doing wrong

For now I am using this:

if (( DNUM 6 ))
then
PAGE="N_CALL";
else
PAGE="PRIMARY"
fi


Regards & Thanks
BN

Reply With Quote
Reply

Viewing: Web Development Archives FAQs Unix/Linux > ksh 88 (( expression1 ? expression2 : expression 3 )) - HelpPlease


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are Off
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway
Stay green...Green IT