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

  Unix/Linux Go Back    

Shell Programming and Scripting Unix shell scripting - KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and shell scripts and shell scripting languages here.

elseif in csh

Shell Programming and Scripting

Closed Linux or Unix Question    
Thread Tools Search this Thread Display Modes
Old Unix and Linux 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

if ( $opt1 == 1 ) then

elseif ( $opt2 == 1 ) then


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

if ( $opt1 == 1 ) then

else if ( $opt2 == 1 ) then


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

Last edited by kristinu; 07-02-2010 at 10:26 AM.. Reason: Clarification
Sponsored Links
Closed Linux or Unix Question

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Unix or Linux Image 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 02:11 PM

All times are GMT -4. The time now is 11:10 PM.