logo

utils-std

Collection of commonly available Unix tools

tty.1 (729B)


  1. .\" utils-std: Collection of commonly available Unix tools
  2. .\" Copyright 2017 Haelwenn (lanodan) Monnier <contact+utils@hacktivis.me>
  3. .\" SPDX-License-Identifier: MPL-2.0
  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 occured.
  23. .El
  24. .Sh SEE ALSO
  25. .Xr ttyname 3
  26. .Sh STANDARDS
  27. .Nm
  28. should be compliant with the
  29. .St -p1003.1-2008
  30. specification.
  31. .Sh AUTHORS
  32. .An Haelwenn (lanodan) Monnier Aq Mt contact+utils@hacktivis.me