[olug] am I at the console?

Theodore Katseres tedkat at gmail.com
Fri Mar 24 23:36:53 UTC 2006


On 3/24/06, thelarsons3 at cox.net <thelarsons3 at cox.net> wrote:
> Hello,
>
> I want a shell script to check if it's being run at the console, so it can act differently than it would in a virtual/remote terminal.  Is this possible?  A portable (cross-Unix) solution would be great, but I'll take anything.

tty

Capture the output and check for /dev/pty
if that's true then its a remote console

Works for Linux and AIX

--
Ted Katseres
      ||=O=||



More information about the OLUG mailing list