cvs commit: src/usr.bin/script script.c

Colin Percival cperciva at FreeBSD.org
Sun Feb 15 09:30:17 PST 2004


cperciva    2004/02/15 09:30:13 PST

  FreeBSD src repository

  Modified files:
    usr.bin/script       script.c 
  Log:
  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
  
  Revision  Changes    Path
  1.24      +3 -1      src/usr.bin/script/script.c


More information about the cvs-src mailing list