A few of my scripts (keymap changing, public key adding) need to act differently when in a virtual console vs. in an xterm.  What's the real code for#!/bin/kshif [[ in_a_virtual_console ]]; then...else...fi
How can my script know when I'm in a virtual console vs. an xterm?
shell;command line;terminal;xterm
It sounds to me like you want to check whether or not there is a X server to connect to.Something like:if [ -n $DISPLAY ]; then  : Xelse  : no Xfi