The other pseudo-device, the slave, emulates a hardware serial port device,[1] and is used by terminal-oriented programs such as shells (e.g. bash) as a processes to read/write data back from/to master endpoint.
[5] Pseudoterminals were present in the DEC PDP-6 Timesharing Monitor at least as early as 1967, and were used to implement batch processing.
Implementations of Unix pseudo terminals date back to the modifications that RAND and BBN made to a 6th Edition in the late 1970s to support remote access over a network.
Pseudoterminals have been standardized by the Single UNIX Specification (maintained by the Austin Group) since 2004 (Issue 6) [10].
Screen and Tmux are used to add a session context to a pseudoterminal, making for a much more robust and versatile solution.
The master device file, which generally has a name of the form /dev/pty[p-za-e][0-9a-f], is the endpoint for communication with the terminal emulator.
Also, finding the first free pty master can introduce a race condition unless a locking scheme is adopted.
script
unix command that records user's input for replaying it later.