Re: script input redirection / eof handling

Phillip Susi
2013-12-02T18:06:05Z

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 12/2/2013 12:02 PM, Karel Zak wrote:
> never ending orphans suck...

Yes, but the idea is not to orphan them in the first place and wait
for them to terminate instead.

> The possible solution (hack) to emulate end-of-file is by write
> "exit\n" to the master tty. For example patch below works for me
> (it also make it more robust for non-ttys).

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?

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.17 (MingW32)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQEcBAEBAgAGBQJSnMwNAAoJEI5FoCIzSKrwwvYH+wRd0hXZwZKhElWgpLIjWNOO
82ulPzt1Cld085qllaG8VvO0CSN3JERHD5Eo8iB+YIuI32lNO2dGuGw0MwYJ72cn
whUEqT7BNcnDCDqhPba/ZYcGJ8mCp+3+58BDth8NPu+nma7d6V0n4sAbqO+w6uCS
VZOO9qo2cKYGqs7E2YYWLHBadMGkyLjpDd9j7ZsLxEe6ezb1vFLxSmJQ3CiNLz+i
q2okm0GUipkhMAMCC8zuV1GnUf5sJuSx6QiSkIE5Mok9d8HqOtXTt8F7URAa+YVC
tBtM7dMIfXEQCJil16hTn+KdgiAtNE4BaGkyevW2kohwmKQgKU51/CHlofWGK1s=
=6Ihg
-----END PGP SIGNATURE-----