Date: Mon, 21 Aug 2000 17:35:55 -0500 (CDT) From: Mike Meyer <mwm@mired.org> To: Alfred Perlstein <bright@wintelcom.net> Cc: questions@freebsd.org Subject: Re: Is it possible to discriminate between shell used in CLI and XWindowmode ? Message-ID: <14753.44747.906899.853494@guru.mired.org> In-Reply-To: <111165061@toto.iv>
next in thread | previous in thread | raw e-mail | index | archive | help
Alfred Perlstein writes: > * Ariel Burbaickij <Ariel.Burbaickij@mni.fh-giessen.de> [000820 08:38] wrote: > > Concrete: I want to leave csh as root shell on the console and work as > > root with bash in X Window is it somehow managable ? > Figure out how to test if the DISPLAY variable is set in your enviornment, > if it is then try to exec bash. That's one way. You could also check TERM, which will be different in those two environments. Personally, I'd check the tty you are on: if (`tty` =~ /dev/ttyp*) then exec bash endif Of course, all three of these tests give different behavior if you're on something other than the console or an x terminal emulator of some kind. <mike To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?14753.44747.906899.853494>