• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: TERM_PROGRAM: Undefined variable.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

References: 
 >Re: TERM_PROGRAM: Undefined variable. (From: Dave Schroeder <email@hidden>)

  • Prev by Date: Codetek Virtual Desktop
  • Next by Date: Re: I Hate "Haxies" (was X11 Dies When I Launch New Apps)
  • Previous by thread: Re: TERM_PROGRAM: Undefined variable.
  • Next by thread: Re: TERM_PROGRAM: Undefined variable.
  • Index(es):
    • Date
    • Thread