Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Am trying from y'day.. but this fol

Status
Not open for further replies.

nithin97

Programmer
Oct 23, 2002
25
US
Am trying from y'day.. but this following switch case is not at all working.. problem is if i give this multiple choice for "case" its not working.. it just works when i give just one value for "case"... your help appreciated...

Switch Case problem....

switch ($month)
case [1][3][5][7][8][10][12]:
@ day = 31
breaksw
case [4][6][9][11]:
@ day = 30
breaksw
endsw
 
#!/bin/sh
case $x in [13578]|1[02]) day=31
;; [469]|11) day=30
;; 2) day=28+func-to-get-leap-year(year)
;; *) exit 1
;; esac
-----------
when they don't ask you anymore, where they are come from, and they don't tell you anymore, where they go ... you'r getting older !
 
hi jamisar.. i forgot to mention.. i need to code only in c-shell... can you pls let me know in c-shell.. thanks for your help..
 
nithin97: you sure can translate sh -> csh
finally: you are PROGRAMMER
-----------
when they don't ask you anymore, where they are come from, and they don't tell you anymore, where they go ... you'r getting older !
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top