diff options
author | cperciva <cperciva@FreeBSD.org> | 2004-02-15 17:30:13 +0000 |
---|---|---|
committer | cperciva <cperciva@FreeBSD.org> | 2004-02-15 17:30:13 +0000 |
commit | e2c5d659cc6c9906592b232f96d8bebdc5f9966a (patch) | |
tree | 4ce8c64fd19756fb195c1ad97da43d433878f6c0 /lib/libc/stdlib/strfmon.c | |
parent | d2e6533b8db9cf22286d5c119a6aa68dec8f0b1b (diff) | |
download | FreeBSD-src-e2c5d659cc6c9906592b232f96d8bebdc5f9966a.zip FreeBSD-src-e2c5d659cc6c9906592b232f96d8bebdc5f9966a.tar.gz |
Attempt #2 to fix script(1) if the standard input is closed: If we
read EOF from STDIN_FILENO, write zero bytes into the pseudo-terminal;
this is interpreted as an EOF by the program being scripted.
I've tested this with two non-interactive scripts:
# echo 5 | script foo sh -c 'read x; sleep $x; echo bar'
# echo bar | xargs script foo echo
and one interactive program:
# script foo more /etc/passwd
and everything seems to work properly...
PR: bin/56166, bin/57414, ports/57415, ports/60534
Approved by: rwatson (mentor)
MFC after: 2 weeks
Diffstat (limited to 'lib/libc/stdlib/strfmon.c')
0 files changed, 0 insertions, 0 deletions