if ("`tty`" == "/dev/console") then
# console dependent instructions
(The coding of the 'if' instruction based upon assumption you are using
* - * - *
Paul-Joseph "Dragon" de Werk | Carpe diem.
Department of Computer Science | "First things first, but not
California State University, Fresno | necessarily in that order."
HELLO! I'm a .signature virus! Join in and copy me into yours!
I use zgv to display images when I am in the console (ttyv0).
This won't work if I am in another ttyv.
I want to write a script to use zgv to display a picture if I
am in the console and xzgv if I am in X. I want it to bail
otherwise (i.e. if I am in another ttyv).
I want this script (showpics) to be mapped to image/* in
.mailcap and in lynx.
I know I can test $DISPLAY to see if I am in X (it isn't set
if I am in a ttyv.
However, tty doesn't tell me if lynx or the mail program I am
using is running in ttyv0.
Here is my attempt at the script:
if [ "$DISPLAY" = "" ];
#if [ "$ISCONSOLE" = "/dev/ttyv0" ];
echo not in console
This works fine from the command line. But 'tty' returns
"not a tty" when this script is invoked by lynx, etc. I
gather this doesn't work because STANDARD INPUT is then
something else. What I need to know is whether lynx or
whatever is running in the console so that zgv will
succeed. How can my script tell?
It's important for us to explain to our nation that life is important. It's
not only life of babies, but it's life of children living in, you know, the
dark dungeons of the Internet.--G.W. Bush, Arlington Heights, Ill.,10/24/00