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
..
2003-06-09 19:21:35 +00:00
Use
2003-06-06 13:46:55 +00:00
2002-09-04 23:29:10 +00:00
2003-06-14 19:32:52 +00:00
2003-06-14 19:32:52 +00:00
2002-12-11 17:26:53 +00:00
2004-02-10 18:41:52 +00:00
2002-09-04 23:29:10 +00:00
2003-09-14 13:41:59 +00:00
2003-06-08 13:43:56 +00:00
2003-05-03 15:55:23 +00:00
2003-06-30 11:51:21 +00:00
2002-11-26 10:57:57 +00:00
2002-09-04 23:29:10 +00:00
2002-09-04 23:29:10 +00:00
2002-12-27 12:15:40 +00:00
2002-09-04 23:29:10 +00:00
2002-12-05 08:50:00 +00:00
2002-09-04 23:29:10 +00:00
2002-11-26 11:25:04 +00:00
2003-08-17 10:24:53 +00:00
Use
2003-06-06 13:46:55 +00:00
2003-06-08 13:45:37 +00:00
2004-01-22 04:24:15 +00:00
2004-02-02 18:00:06 +00:00
2002-09-04 23:29:10 +00:00
2003-02-04 18:26:08 +00:00
2004-02-05 22:01:28 +00:00
2002-12-27 12:15:40 +00:00
2002-09-04 23:29:10 +00:00
2003-08-22 17:55:56 +00:00
2002-09-04 23:29:10 +00:00
2002-12-27 12:15:40 +00:00
2003-08-17 10:33:54 +00:00
2002-09-04 23:29:10 +00:00
2003-08-05 06:50:28 +00:00
2002-09-04 23:29:10 +00:00
2003-06-19 09:19:51 +00:00
2003-06-08 13:58:08 +00:00
2003-10-26 04:57:32 +00:00
2003-10-26 04:57:32 +00:00
2003-10-26 04:58:44 +00:00
2003-10-06 01:55:17 +00:00
2004-02-02 18:01:19 +00:00
2002-11-26 17:33:37 +00:00
2002-09-04 23:29:10 +00:00
2003-09-06 18:36:51 +00:00
2002-09-04 23:29:10 +00:00
2003-06-08 13:58:08 +00:00
2003-09-04 20:05:46 +00:00
2003-06-08 13:58:08 +00:00
2002-09-04 23:29:10 +00:00
2002-09-04 23:29:10 +00:00
2002-09-04 23:29:10 +00:00
2003-02-21 08:46:44 +00:00
2002-11-26 17:33:37 +00:00
2002-11-26 17:33:37 +00:00
2002-12-30 09:48:40 +00:00
2002-09-04 23:29:10 +00:00
2004-02-07 07:22:11 +00:00
2003-10-26 05:28:01 +00:00
2003-10-26 05:28:01 +00:00