elseif in csh | Unix Linux Forums | Shell Programming and Scripting

  Go Back    


Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

elseif in csh

Shell Programming and Scripting


Closed Thread    
 
Thread Tools Search this Thread Display Modes
    #1  
Old 07-02-2010
kristinu kristinu is offline
Registered User
 
Join Date: Dec 2009
Last Activity: 10 December 2014, 12:34 PM EST
Posts: 862
Thanks: 62
Thanked 8 Times in 8 Posts
"elseif" or "else if" in csh

I have been using the if statement in csh like this


Code:
if ( $opt1 == 1 ) then
 .....

elseif ( $opt2 == 1 ) then

......
endif


Seems to work, but got

Badly placed ()'s.


When I used a space in the elseif, a space between the 'else' and the 'if' it worked


Code:
if ( $opt1 == 1 ) then
 .....

else if ( $opt2 == 1 ) then

......
endif

Any idea why the thing sometimes works and sometimes not???

Last edited by kristinu; 07-02-2010 at 11:26 AM.. Reason: Clarification
Sponsored Links
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Awk if elseif syntax error pinnacle Shell Programming and Scripting 8 05-18-2009 03:11 PM



All times are GMT -4. The time now is 05:54 AM.