[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: How to tell if I'm logged on from console?



On Wed, May 13, 1998 at 01:17:25AM -0400, Will Lowe wrote:
> On Wed, 13 May 1998, Hamish Moffatt wrote:
> > > Anybody got any way for a script to tell if 
> > > 1) I'm logged onto the console
> > 
> > Well, if `tty` matches /tty\d/ is probably best.
> 
> Well,  yes,  except that I might be on from the console on /dev/tty3 ...
> all I really care about is that I'm sitting physically in front of
> computer,  so that /dev/tty{whatever} is actually connected to my monitor
> and keyboard rather than being a serial line or an ethernet line...

Yes, that's why I said /tty\d/ -- if you're on the console,
`tty` will always be /dev/ttyX, rather than /dev/ttypX, /dev/ttySN etc.
Am I missing something?

Hamish
-- 
Hamish Moffatt, hamish@debian.org, hamish@rising.com.au, hmoffatt@mail.com
Latest Debian packages at ftp://ftp.rising.com.au/pub/hamish. PGP#EFA6B9D5
CCs of replies from mailing lists are welcome.   http://hamish.home.ml.org


--
To UNSUBSCRIBE, email to debian-user-request@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org


Reply to: