logo

utils-std

Collection of commonly available Unix tools git clone https://anongit.hacktivis.me/git/utils-std.git

tty.1 (746B)


  1. .\" utils-std: Collection of commonly available Unix tools
  2. .\" Copyright 2017 Haelwenn (lanodan) Monnier <contact+utils@hacktivis.me>
  3. .\" SPDX-License-Identifier: 0BSD
  4. .Dd 2024-03-16
  5. .Dt TTY 1
  6. .Os
  7. .Sh NAME
  8. .Nm tty
  9. .Nd return pathname of current terminal
  10. .Sh SYNOPSIS
  11. .Nm
  12. .Sh DESCRIPTION
  13. .Nm
  14. prints the name of the terminal used for standard input, or if not a terminal prints "not a tty\n" and exits 1.
  15. .Sh EXIT STATUS
  16. .Bl -tag -width >1
  17. .It 0
  18. Standard input is a terminal.
  19. .It 1
  20. Standard input is not a terminal.
  21. .It >1
  22. An error occurred.
  23. .El
  24. .Sh SEE ALSO
  25. .Xr ttyname 3
  26. .Sh STANDARDS
  27. .Nm
  28. should be compliant with the
  29. IEEE Std 1003.1-2024 (“POSIX.1”)
  30. specification.
  31. .Sh AUTHORS
  32. .An Haelwenn (lanodan) Monnier Aq Mt contact+utils@hacktivis.me