pty creates a pseudo pty and then runs
command with arguments given by
arg and the standard input, standard
output, and standard error connected to the pseudo terminal. By default, the
pty creates a new session.
If command does not contain a /, the PATH variable will be used to locate the command.
Input to pty will be written to the standard input of this command. The standard output and standard error from the command
will be written to the standard output of pty.
The pty commmand terminates when the command completes.
If the command determined by
command is run the exit status of
pty is that of this command. Otherwise, the exit
status is one of the following:
- 127
- The command is found but cannot be executed.
- 128
- The command could not be found.