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: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] > Sent: Wednesday, May 27, 1998 11:50 PM > To: Debian User List > Cc: recipient list not shown; @[EMAIL PROTECTED] > 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 ([EMAIL PROTECTED]) > > -------------------------------------------------------------- > ----------------- > Curiousity may kill the cat, but a 12 gauge is quicker! > -------------------------------------------------------------- > ----------------- > Debian GNU/Linux.... Ooohh You are missing out! > > > -- > To UNSUBSCRIBE, email to [EMAIL PROTECTED] > with a subject of "unsubscribe". Trouble? Contact > [EMAIL PROTECTED] > -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]