[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[ale] Bash Scripting: How to pass "yes" + carriage return?
- Subject: [ale] Bash Scripting: How to pass "yes" + carriage return?
- From: meuon at geeklabs.com (Mike Harrison)
- Date: Fri, 11 Nov 2005 08:33:58 -0500 (EST)
- In-reply-to: <000001c5e6ba$960ff1a0$6401a8c0@win2kpro1>
Ryan Fish requested:
> I am in need of figuring out how to pass a "yes" followed by a carriage
> return via a bash script so a backup process can run successfully each day.
> 1) ssh to RaQ server as root
> 2) run cmuExport
> 3) copies contents of export to NAS device
I don't know cmuExport, but I would hope/expect it to has a command line
switch for 'OverWrite' but if not, take a look at the 'expect' utility
program:
"Expect is a program that "talks" to other interactive programs accord-
ing to a script. Following the script, Expect knows what can be
expected from a program and what the correct response should be. An
interpreted language provides branching and high-level control struc-
tures to direct the dialogue. In addition, the user can take control
and interact directly when desired, afterward returning control to
the script."