logo

utils-std

Collection of commonly available Unix tools
commit: 8be7e7a3048b892ccb0a500594c7b431940281c6
parent 417d5d8c821c9f3a90b8eb9e9f47929b99340d7b
Author: Haelwenn (lanodan) Monnier <contact@hacktivis.me>
Date:   Sat, 16 Mar 2024 21:26:06 +0100

cmd/tty.1: new

Diffstat:

Acmd/tty.132++++++++++++++++++++++++++++++++
1 file changed, 32 insertions(+), 0 deletions(-)

diff --git a/cmd/tty.1 b/cmd/tty.1 @@ -0,0 +1,32 @@ +.\" utils-std: Collection of commonly available Unix tools +.\" Copyright 2017 Haelwenn (lanodan) Monnier <contact+utils@hacktivis.me> +.\" SPDX-License-Identifier: MPL-2.0 +.Dd 2024-03-16 +.Dt TTY 1 +.Os +.Sh NAME +.Nm tty +.Nd return pathname of current terminal +.Sh SYNOPSIS +.Nm +.Sh DESCRIPTION +.Nm +prints the name of the terminal used for standard input, or if not a terminal prints "not a tty\n" and exits 1. +.Sh EXIT STATUS +.Bl -tag -width >1 +.It 0 +Standard input is a terminal. +.It 1 +Standard input is not a terminal. +.It >1 +An error occured. +.El +.Sh SEE ALSO +.Xr ttyname 3 +.Sh STANDARDS +.Nm +is compliant with the +.St -p1003.1-2008 +specification. +.Sh AUTHORS +.An Haelwenn (lanodan) Monnier Aq Mt contact@hacktivis.me