logo

openpt

Fake a pseudo-terminal for testsuites

openpt.1 (877B)


  1. .\" Copyright 2017 Haelwenn (lanodan) Monnier <contact+utils-openpt@hacktivis.me>
  2. .\" SPDX-License-Identifier: MIT
  3. .Dd 2024-06-02
  4. .Dt OPENPT 1
  5. .Os
  6. .Sh NAME
  7. .Nm openpt
  8. .Nd Start program in a new pseudo-terminal
  9. .Sh SYNOPSIS
  10. .Nm
  11. .Ar command
  12. .Op argument...
  13. .Sh DESCRIPTION
  14. .Nm
  15. executes
  16. .Ar command
  17. inside of a new pseudo-terminal, with standard I/Os copied in/out.
  18. .Pp
  19. Note that when executing prompts such as a shell, you might need
  20. to send an explicit EOF, like so:
  21. .Dl % printf 'ls\en\e004' | openpt sh
  22. This behavior might change in future versions.
  23. .Sh EXIT STATUS
  24. .Ex -std
  25. .Sh EXAMPLES
  26. Test interactive mode of
  27. .Cm mv :
  28. .Bd -literal -offset indent
  29. #!/bin/sh
  30. set -e
  31. touch src no_write
  32. chmod -w no_write
  33. echo y | openpt mv src no_write
  34. test ! -e src
  35. test -f no_write
  36. .Ed
  37. .Sh STANDARDS
  38. None.
  39. .Sh AUTHORS
  40. .An Haelwenn (lanodan) Monnier Aq Mt contact+utils-openpt@hacktivis.me