What are the differences between running a shell (e.g., sh) through a TTY, PTY, or execv() using pipes?
I've wondered what are the differences between invoking a shell, e.g., sh
through a TTY (terminal) or PTY(pseudoterminal), or from C-program using execv()
and pipes for stdin/stdout/stderr?
In particular, I'm interested in the differences between TTY/PTY and the C-program, since TTY and PTY should behave identical?
Invoking sh
through a TTY/PTY, then this (pseudo)terminal interpret/convert the input before sending it sh
. Likewise, it echoes the output from sh
to the screen of the terminal? Is this the stdout of the (pseudo)terminal?
Are the only differences between TTY/PTY and C-program that the TTY/PTY acts as a "layer" of communication between the process sending/receiving data to sh
, or are there other differences?