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

RE: Getting ttyx



Several ways, including piping the tty output to sed or cut or awk.  But
my preference would be:

	basename $(tty) # assumes you are using bash, ksh etc.
or

	basename `tty` # back quotes for sh

---
Bob McGowan
i'm:  bob dot mcgowan at artecon dot com

> -----Original Message-----
> From: mickyb@es.co.nz [mailto:mickyb@es.co.nz]
> Sent: Wednesday, May 27, 1998 11:50 PM
> To: Debian User List
> Cc: recipient list not shown; @lists.debian.org@artecon
> Subject: Getting ttyx
> 
> 
> 
> What is the best way to get the current console's tty? I know 
> tty does the
> job, but how do I find the name WITHOUT the /dev/ ? i.e. 
> tty1, tty2, tty3
> etc? I want to use it with bl in a script.
> 
> 
>                        Michael Beattie (mickyb@es.co.nz)
> 
> --------------------------------------------------------------
> -----------------
>             Curiousity may kill the cat, but a 12 gauge is quicker!
> --------------------------------------------------------------
> -----------------
>                 Debian GNU/Linux....  Ooohh You are missing out!
> 
> 
> --
> 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: