John writes:

> 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?

You can check the existance of the DISPLAY environment variable:

if [[ $DISPLAY ]]
then
        echo "We're running under X"
else
        echo "No X running."
fi


        Alex
-- 
gentoo-user@gentoo.org mailing list

Reply via email to