[Tfug] Re: csh/tcsh users

Stephen Hooper schooper at email.arizona.edu
Thu Nov 3 01:13:11 MST 2005


t takahashi wrote:
> try using (...) or {...} to force it.
> 
> long term solution: switch to bash or zsh.  they suck in different ways,
> but both suck less than csh.  imho.
> 

This is fun:

http://www.faqs.org/faqs/unix-faq/shell/csh-whynot/


> to get you started, i recommend this syntax:
> 
> if [ ... ]
> then
>         if [ ... ]
>         then
>                 ...
>         fi
>         ...
> fi
> 
> to look up how to use [] look up test in the man pages or do help test in bash.

>>If BUILD_G is NO, it works fine.  Otherwise, rather than not executing
>>everything between the initial "if" and the final "endif" the shell jumps
>>to the first "endif" it encounters and starts from there.  In this case, it
>>starts in at the
>>"if(!(-e $refFile))then" line and keeps going.  Sorry, but this is just
>>wrong.

 From the above "CSH Programming Considered Harmful":

Your vendor may have attempted to fix this bug, but odds are good
that their csh still won't be able to handle

     if(0) then
       if(1) then
           echo A: got here
       else
           echo B: got here
       endif
       echo We should never execute this statement
     endif

---

Is that what your seeing?  Maybe it is still harmful? ;)


More information about the tfug mailing list