logo

utils-std

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

tty.sh (374B)


  1. #!/bin/sh
  2. # SPDX-FileCopyrightText: 2017 Haelwenn (lanodan) Monnier <contact+utils@hacktivis.me>
  3. # SPDX-License-Identifier: MPL-2.0
  4. target="$(dirname "$0")/../cmd/tty"
  5. plans=1
  6. . "$(dirname "$0")/tap.sh"
  7. tty >/dev/null 2>/dev/null
  8. case $? in
  9. 0)
  10. t noargs '' "$(tty)
  11. "
  12. ;;
  13. 1)
  14. t --exit=1 noargs '' 'not a tty
  15. '
  16. ;;
  17. *)
  18. skip noargs "system tty exited with $?"
  19. ;;
  20. esac