[daip] Problem in AIPSPATH.CSH

Patrick P. Murphy pmurphy at NRAO.EDU
Thu Mar 8 09:41:32 EST 2001


"RM" == Ralph Marson <rmarson at aoc.nrao.edu> writes:

RM> There is a problem in the AIPSPATH.CSH script that can occur 
RM> at the AOC when used with the standard 'dot files'. 

I actually think this is a problem with the "standard" dot files.

RM> It occurs because, for non-interactive shells the .tcshrc file has the
RM> following

RM>   if ( $?prompt ) then           # "prompt" is set if shell has a tty
RM>      set interact = 1
RM>   else
RM>      set interact = 0
RM>      alias echo /bin/true        # echoing to non-tty may cause process to fail

I remember arguing about this detail years ago when the CCE first came
around.  It and other issues prompted me to not recommend this environment
to CV users and sparked the /opt/local/share/cv/ set of dot files for bash
users.  Sorry, I never had the time to port them to csh/tcsh.

Aliasing echo is NOT a good idea.  My scripts create a function that echos
if you're interactive and does nothing if not.  That (IMHO) is the right
solution.  And the function is not called "echo"!

RM> If the user then has, further down in their .tcshrc file, the line
RM>   source /AIPS/LOGIN.CSH
RM> (which calls $AIPS_ROOT/AIPSPATH.CSH script) then the line 
RM>    setenv PATH `echo $tempath | sed 's/:$//'`
RM> will result in the users PATH being reset to an empty value. 

Like I said, messing with a builtin or fundamental feature like 'echo' is
not advisable.  One fix would be to alter the LOGIN.CSH script so that it
unaliases "echo", but that seems the wrong thing to do; it's a kludge and
a workaround, and fixes a symptom.

				- Pat



More information about the Daip mailing list