[me@host scratch]$ ptyexec man vim | grep stdin - The file to edit is read from stdin. Commands are read from stderr, which should be a tty. [me@host scratch]$