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

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



Will,

I think Mr. Moffatt is on the right track. Won't `tty` actually be ttyp# if
you are connected via ethernet? Similarly, I think it will be different when
you are connected via serial port.

I've used: x = `tty | grep 'tty[012345]'` to do exactly what you are 
asking about. 

Ken

At 01:17 AM 5/13/98 , 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...
>
>						thanks though
>                     					Will
>
>
>--------------------------------------------------------------------------
>|             harpo@udel.edu lowe@cis.udel.edu lowe@debian.org           |
>|			http://www.cis.udel.edu/~lowe/		         |
>|    PGP Public Key:  http://www.cis.udel.edu/~lowe/index.html#pgpkey    |
>--------------------------------------------------------------------------
>|           You think you're so smart,  but I've seen you naked          |
>|                  and I'll prob'ly see you naked again ...              |
>|                 --The Barenaked Ladies,  "Blame It On Me"              |
>--------------------------------------------------------------------------
>
>
>--
>To UNSUBSCRIBE, email to debian-user-request@lists.debian.org
>with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
> 


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


Reply to: