The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
Google UNIX.COM



View Single Post in UNIX Forums - Click on the Thread or Permalink to View Entire Thread -->
  #9 (permalink)  
Old 01-30-2002
rwb1959's Avatar
rwb1959 rwb1959 is offline
Registered User
 

Join Date: Aug 2001
Location: Virginia, USA
Posts: 438
I'm assuming that...

program << eof >> $result 2>&1

...is inside a shell script.
In this script, you would simply enter the
actual responses thar "program" reads...

program << eof >> $result 2>&1
answer1
answer2
...
answer5
eof

The "<< eof" creates a "here document" which
basically says, redirect the standard input
to "program" to everything between the "eof"'s
The ">> $result says append the standard
output of "program" to whatever file $result
points to.