Re: script input redirection / eof handling

Karel Zak
2013-12-02T23:25:17Z

On Mon, Dec 02, 2013 at 01:06:05PM -0500, Phillip Susi wrote:
> That only works if the program on the other end knows what "exit"
> means, which is basically only true if it's a shell. Surely there
> must be a proper way to signal EOF over a pty? Can you use shutdown()
> on a pty?

Oh, now it reminds me... in include/ttyutils.h we have macros to
generate tty control chars, for example ^C

char eof = DEF_EOF;

if (write(master, &eof, 1) < 0) {
warn (_("write failed"));
fail();
}
pause();

is what we need.