freebsd-skq/usr.bin/script
cperciva e2c5d659cc 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
2004-02-15 17:30:13 +00:00
..
Makefile Minor style stuff, use __FBSDID(), remove to-be-default WARNS=2. 2001-12-12 23:23:52 +00:00
script.1 Fix SYNOPSIS of manual page, clustering no-arg options correctly. 2004-01-22 21:26:41 +00:00
script.c Attempt #2 to fix script(1) if the standard input is closed: If we 2004-02-15 17:30:13 +00:00