Re: TERM_PROGRAM: Undefined variable.
Re: TERM_PROGRAM: Undefined variable.
- Subject: Re: TERM_PROGRAM: Undefined variable.
- From: Douglas Stetner <email@hidden>
- Date: Tue, 14 Jan 2003 21:45:33 +1000
On 13/01/2003 at 20:06, Dave Schroeder <email@hidden> wrote:
> In /usr/share/tcsh/examples/aliases, change
>
> if ("$TERM_PROGRAM" == "Apple_Terminal") then
>
> to
>
> if ("$?TERM_PROGRAM" == "Apple_Terminal") then
>
> For other discussions and alternate solutions, see also:
>
> http://www.macosxhints.com/article.php?story=20020828090619956
I will make a follow up post to macosxhints as well...
>From the tcsh man page:
$?name
${?name}
Substitutes the string `1' if name is set, `0' if
it is not.
So:
> if ("$?TERM_PROGRAM" == "Apple_Terminal") then
is saying either:
if ("1" == "Apple_Terminal") then
or
if ("0" == "Apple_Terminal") then
which is not what you want.
try:
if ( $?TERM_PROGRAM && "$TERM_PROGRAM" == "Apple_Terminal" ) then
echo "TERM_PROGRAM set $TERM_PROGRAM "
endif
Which tests if the variable exists first and then evaluates it.
Doug
--
Douglas Stetner <email@hidden>
"Oh, a sarcasm detector. *That's* useful."
- Comic Book Guy, "The Simpsons"
_______________________________________________
x11-users mailing list | email@hidden
Help/Unsubscribe: http://www.lists.apple.com/mailman/listinfo/x11-users
Do not post admin requests to the list. They will be ignored.