in reply to Expect.pm and sudo.
Those are backticks, BTW.sudo sh /usr/local/scripts/pre_backup.sh <`echo "X"`
OK, this is not exactly what you asked, but in the age old spirit of TIMTOWTDI and getting around annoying limitations that is integral to Perl, it gets the job done (I hope).
Note that, if your script expects input more than once, you'll have to modify the echo to take this into account.
Caveat: I'm not sure how expect spawns its command lines or how sudo spawns its commands, but if a shell is involved anywhere in there, you'll have to get creative with those backticks and quotes to avoid said shell stomping all over it.
CU
Robartes-
Update: Added caveat.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Expect.pm and sudo.
by sschneid (Deacon) on Oct 16, 2002 at 20:49 UTC | |
by Aristotle (Chancellor) on Oct 17, 2002 at 01:59 UTC |