1*17e867a6Ssevan.\" $NetBSD: tty.1,v 1.10 2019/09/01 18:41:14 sevan Exp $ 2ea2b6c7cSjtc.\" 3ea2b6c7cSjtc.\" Copyright (c) 1990, 1993 4ea2b6c7cSjtc.\" The Regents of the University of California. All rights reserved. 561f28255Scgd.\" 661f28255Scgd.\" This code is derived from software contributed to Berkeley by 761f28255Scgd.\" the Institute of Electrical and Electronics Engineers, Inc. 861f28255Scgd.\" 961f28255Scgd.\" Redistribution and use in source and binary forms, with or without 1061f28255Scgd.\" modification, are permitted provided that the following conditions 1161f28255Scgd.\" are met: 1261f28255Scgd.\" 1. Redistributions of source code must retain the above copyright 1361f28255Scgd.\" notice, this list of conditions and the following disclaimer. 1461f28255Scgd.\" 2. Redistributions in binary form must reproduce the above copyright 1561f28255Scgd.\" notice, this list of conditions and the following disclaimer in the 1661f28255Scgd.\" documentation and/or other materials provided with the distribution. 1789aaa1bbSagc.\" 3. Neither the name of the University nor the names of its contributors 1861f28255Scgd.\" may be used to endorse or promote products derived from this software 1961f28255Scgd.\" without specific prior written permission. 2061f28255Scgd.\" 2161f28255Scgd.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 2261f28255Scgd.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 2361f28255Scgd.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 2461f28255Scgd.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 2561f28255Scgd.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 2661f28255Scgd.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 2761f28255Scgd.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 2861f28255Scgd.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 2961f28255Scgd.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 3061f28255Scgd.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 3161f28255Scgd.\" SUCH DAMAGE. 3261f28255Scgd.\" 33ea2b6c7cSjtc.\" @(#)tty.1 8.1 (Berkeley) 6/6/93 3461f28255Scgd.\" 35*17e867a6Ssevan.Dd September 1, 2019 3661f28255Scgd.Dt TTY 1 3761f28255Scgd.Os 3861f28255Scgd.Sh NAME 3961f28255Scgd.Nm tty 40ea2b6c7cSjtc.Nd return user's terminal name 4161f28255Scgd.Sh SYNOPSIS 428320ff9bSlukem.Nm 4361f28255Scgd.Op Fl s 4461f28255Scgd.Sh DESCRIPTION 4561f28255ScgdThe 468320ff9bSlukem.Nm 4761f28255Scgdutility writes the name of the terminal attached to standard input 4861f28255Scgdto standard output. 4961f28255ScgdThe name that is written is the string returned by 5061f28255Scgd.Xr ttyname 3 . 5161f28255ScgdIf the standard input is not a terminal, the message ``not a tty'' 5261f28255Scgdis written. 5361f28255ScgdThe options are as follows: 5461f28255Scgd.Bl -tag -width Ds 5561f28255Scgd.It Fl s 5661f28255ScgdDon't write the terminal name; only the exit status is affected 5761f28255Scgdwhen this option is specified. 5861f28255ScgdThe 5961f28255Scgd.Fl s 6061f28255Scgdoption is deprecated in favor of the 6161f28255Scgd.Dq Li "test -t 0" 6261f28255Scgdcommand. 6361f28255Scgd.El 6461f28255Scgd.Pp 658320ff9bSlukem.Nm 6661f28255Scgdexits 0 if the standard input is a terminal, 1 if the standard input is 6701869ca4Swiznot a terminal, and >1 if an error occurs. 6861f28255Scgd.Sh SEE ALSO 6961f28255Scgd.Xr test 1 , 7061f28255Scgd.Xr ttyname 3 7161f28255Scgd.Sh STANDARDS 7261f28255ScgdThe 738320ff9bSlukem.Nm 7480d3a747Sjtcutility conforms to 7580d3a747Sjtc.St -p1003.2-92 . 76*17e867a6Ssevan.Sh HISTORY 77*17e867a6SsevanA 78*17e867a6Ssevan.Nm 79*17e867a6Ssevanutility appeared in 80*17e867a6Ssevan.At v1 . 81