[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Env Variables



On Sun, Jun 25, 2000 at 01:47:52AM -0400, Patrick Dahiroc wrote:
> hi
> 
> i set the environmental variable below to dynamically change my xterm
> window to title to the current working directory.
> 
> export PROMPT_COMMAND='echo -ne "\033]2;${USER}: ${PWD}\007"'
> 
> this works really well when i login in X, but when i login from the
> console my system beeps every time since \007 is the bell character.
> is the a variable i can check that would tell me whether i'm running
> from X or from the console, so i can conditionally set the
> PROMPT_COMMAND variable?

You can test whether DISPLAY is set:

if [ -z $DISPLAY ]
then
    echo "DISPLAY not set"
else
    echo "DISPLAY is set"
fi


-- 
Karsten M. Self <kmself@ix.netcom.com>         http://www.netcom.com/~kmself
  Evangelist, Opensales, Inc.                       http://www.opensales.org
   What part of "Gestalt" don't you understand?      Debian GNU/Linux rocks!
     http://gestalt-system.sourceforge.net/      K5: http://www.kuro5hin.org
GPG fingerprint: F932 8B25 5FDD 2528 D595  DC61 3847 889F 55F2 B9B0

Attachment: pgpcriALskMcg.pgp
Description: PGP signature


Reply to: