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 -->
  #1 (permalink)  
Old 01-29-2002
erwinspeybroeck erwinspeybroeck is offline
Registered User
 

Join Date: Jan 2002
Posts: 4
Question automate the input in a script

I have a program that i have to run by cron. The program needs user input. So i have to automate that in a littke script.

start of script program.sh:

result=program.log; export result
echo Program starting : `date` >> $result
/usr/local/program >> $result
echo Program running : `date` >> $result


The program normally asks for a string (a pass phrase).
How can i do this ?

I know i have to use something like :

/usr/local/program >> $result 2>&1 <<eof
blablablabla
eof

but i don't get it to work

Thanks in advance
Forum Sponsor