Unix/Linux Go Back    

Shell Programming and Scripting BSD, Linux, and UNIX shell scripting Post awk, bash, csh, ksh, perl, php, python, sed, sh, shell scripts, and other shell scripting languages questions here.

elseif in csh

Shell Programming and Scripting

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: 6 August 2016, 6:52 PM EDT
Posts: 890
Thanks: 65
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

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Linux 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 04:49 PM.