1*b828b0feSThomas Cort.\" $NetBSD: tty.1,v 1.8 2003/08/07 11:16:51 agc Exp $ 2*b828b0feSThomas Cort.\" 3*b828b0feSThomas Cort.\" Copyright (c) 1990, 1993 4*b828b0feSThomas Cort.\" The Regents of the University of California. All rights reserved. 5*b828b0feSThomas Cort.\" 6*b828b0feSThomas Cort.\" This code is derived from software contributed to Berkeley by 7*b828b0feSThomas Cort.\" the Institute of Electrical and Electronics Engineers, Inc. 8*b828b0feSThomas Cort.\" 9*b828b0feSThomas Cort.\" Redistribution and use in source and binary forms, with or without 10*b828b0feSThomas Cort.\" modification, are permitted provided that the following conditions 11*b828b0feSThomas Cort.\" are met: 12*b828b0feSThomas Cort.\" 1. Redistributions of source code must retain the above copyright 13*b828b0feSThomas Cort.\" notice, this list of conditions and the following disclaimer. 14*b828b0feSThomas Cort.\" 2. Redistributions in binary form must reproduce the above copyright 15*b828b0feSThomas Cort.\" notice, this list of conditions and the following disclaimer in the 16*b828b0feSThomas Cort.\" documentation and/or other materials provided with the distribution. 17*b828b0feSThomas Cort.\" 3. Neither the name of the University nor the names of its contributors 18*b828b0feSThomas Cort.\" may be used to endorse or promote products derived from this software 19*b828b0feSThomas Cort.\" without specific prior written permission. 20*b828b0feSThomas Cort.\" 21*b828b0feSThomas Cort.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 22*b828b0feSThomas Cort.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 23*b828b0feSThomas Cort.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 24*b828b0feSThomas Cort.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 25*b828b0feSThomas Cort.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 26*b828b0feSThomas Cort.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 27*b828b0feSThomas Cort.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 28*b828b0feSThomas Cort.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 29*b828b0feSThomas Cort.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 30*b828b0feSThomas Cort.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 31*b828b0feSThomas Cort.\" SUCH DAMAGE. 32*b828b0feSThomas Cort.\" 33*b828b0feSThomas Cort.\" @(#)tty.1 8.1 (Berkeley) 6/6/93 34*b828b0feSThomas Cort.\" 35*b828b0feSThomas Cort.Dd June 6, 1993 36*b828b0feSThomas Cort.Dt TTY 1 37*b828b0feSThomas Cort.Os 38*b828b0feSThomas Cort.Sh NAME 39*b828b0feSThomas Cort.Nm tty 40*b828b0feSThomas Cort.Nd return user's terminal name 41*b828b0feSThomas Cort.Sh SYNOPSIS 42*b828b0feSThomas Cort.Nm 43*b828b0feSThomas Cort.Op Fl s 44*b828b0feSThomas Cort.Sh DESCRIPTION 45*b828b0feSThomas CortThe 46*b828b0feSThomas Cort.Nm 47*b828b0feSThomas Cortutility writes the name of the terminal attached to standard input 48*b828b0feSThomas Cortto standard output. 49*b828b0feSThomas CortThe name that is written is the string returned by 50*b828b0feSThomas Cort.Xr ttyname 3 . 51*b828b0feSThomas CortIf the standard input is not a terminal, the message ``not a tty'' 52*b828b0feSThomas Cortis written. 53*b828b0feSThomas CortThe options are as follows: 54*b828b0feSThomas Cort.Bl -tag -width Ds 55*b828b0feSThomas Cort.It Fl s 56*b828b0feSThomas CortDon't write the terminal name; only the exit status is affected 57*b828b0feSThomas Cortwhen this option is specified. 58*b828b0feSThomas CortThe 59*b828b0feSThomas Cort.Fl s 60*b828b0feSThomas Cortoption is deprecated in favor of the 61*b828b0feSThomas Cort.Dq Li "test -t 0" 62*b828b0feSThomas Cortcommand. 63*b828b0feSThomas Cort.El 64*b828b0feSThomas Cort.Pp 65*b828b0feSThomas Cort.Nm 66*b828b0feSThomas Cortexits 0 if the standard input is a terminal, 1 if the standard input is 67*b828b0feSThomas Cortnot a terminal, and \*[Gt]1 if an error occurs. 68*b828b0feSThomas Cort.Sh SEE ALSO 69*b828b0feSThomas Cort.Xr test 1 , 70*b828b0feSThomas Cort.Xr ttyname 3 71*b828b0feSThomas Cort.Sh STANDARDS 72*b828b0feSThomas CortThe 73*b828b0feSThomas Cort.Nm 74*b828b0feSThomas Cortutility conforms to 75*b828b0feSThomas Cort.St -p1003.2-92 . 76