John J. Foster wrote:
On Tue, Aug 01, 2006 at 03:43:12PM -0400, Philip Webb wrote:
060801 John J. Foster wrote:
In a bash script, how can I test whether the script itself is being run
from a virtual terminal, or from an emulator like konsole within X?
'echo $DISPLAY' returns ':0' from Konsole,
but nothing from a raw terminal called up via  Ctl-Alt-F2 .

Of the different methods suggested, I like this one best.

This will also be set in ssh sessions with X forwarding turned on. You might want to check whether you're in one of those as well.

Thanks,
Donnie
--
gentoo-user@gentoo.org mailing list

Reply via email to