HomeFreeBSD

Attempt #2 to fix script(1) if the standard input is closed: If we
rS125848Unpublished

Unpublished Commit ยท Learn More

No further details are available.

Description

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:

  1. echo 5 | script foo sh -c 'read x; sleep $x; echo bar'
  2. 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

Details

Provenance
cpercivaAuthored on
Parents
rS125847: Remove opv_desc_vector from vfs_add_vnodeops, since it is defined
Branches
Unknown
Tags
Unknown

Event Timeline