TERM_PROGRAM: Undefined variable.

holmBrew

Official Volunteer
When I ssh into my box (since the 10.2.x upgrade) I get the following message upon login:


Last login: Wed Sep 18 15:08:57 2002
Welcome to Darwin!
TERM_PROGRAM: Undefined variable.


And...my PATH ends up being this:

PATH=/bin:/sbin:/usr/bin:/usr/sbin

instead of what it normally is...this:

PATH=~/bin/powerpc-apple-darwin:/Users/username/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin

Can somebody help me with this? I don't really care about the message: TERM_PROGRAM: Undefined variable., but I can't help thinking that the two may be related.
 
You can edit the file /etc/csh.login to change your path.

FWIW, my path is /bin:/sbin:/usr/bin:/usr/sbin
and I don't get the same error as you.
 
I guess my real problem is that I need to have those other paths available for remote sessions.

I need this PATH for remote sessions:

PATH=~/bin/powerpc-apple-darwin:/Users/username/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin
 
Do you mean for remote SSH login? I login to my Mac with SSH all the time without problems. Even so, you can change your PATH to whatever you want by editing the /etc/csh.login file
 
Some how I hosed the /etc/csh.cshrc, /etc/csh.login, and /etc/csh.logout

Those are fixed now. Still getting that funky TERM_PROGRAM: Undefined variable.

Thanks for the help.
 
holmBrew,

There is a typo in /usr/share/tcsh/examples/aliases. Change the line that says:

if ("$TERM_PROGRAM" == "Apple_Terminal") then

to:

if ("$?TERM_PROGRAM" == "Apple_Terminal") then


Cheers...
 
The "?" is the C shell way of saying "if the variable isn't defined, return NULL rather than an error." In Bash undefined variables by default are equal to NULL so as long as it was quoted properly, it wouldn't be an error. A neat alternative in Bash, however, is to use a notation like ${TERM:-tty} which says that if TERM is defined, use its value, otherwise use the value 'tty' at this point.
 
That worked like a charm! Thanks for all the help!

d1taylor - I just may have to buy your book. :)
 
Back
Top