Re: bash script to answer a prompt
- From: Bit Twister <BitTwister@xxxxxxxxxxxxxxxx>
- Date: Fri, 21 Apr 2006 08:21:59 -0500
On 21 Apr 2006 04:41:16 -0700, rupert@xxxxxxxxxxxxxxxx wrote:
I'm new to bash scripting and i'm struggling to express the correct
search on google. Does anybody know what it is called when you actually
answer a prompt with the script? eg
cd ~/aProgramDirectory # goes into the directory I want..
someCommand # runs the program, it starts and asks;
do you want to do this?[y/n] ; # I need to type yes here...
Depends on where the program is expecting input. Try
#************ start of script **************
_orig_dir=$PWD
cd ~/aProgramDirectory
program_you_want_2_run_here
y
#then on completion of the job I want to...
cd $_orig_dir
#then does other stuff....
#************ end of script **************
Some light reading found here
! bash script advanced documentation
http://tldp.org/LDP/abs/html/index.html
! bash script introduction to Linux documentation
http://tldp.org/LDP/intro-linux/html/index.html
the problem is the programs stops running when it get's to a prompt
any ideas?
You may have to use expect
.
- References:
- bash script to answer a prompt
- From: rupert
- bash script to answer a prompt
- Prev by Date: Re: Enabling telnet, ftp, pop3 for root...
- Next by Date: Re: Enabling telnet, ftp, pop3 for root...
- Previous by thread: bash script to answer a prompt
- Next by thread: Re: bash script to answer a prompt
- Index(es):
Relevant Pages
|