On Tue, 25 Sep 2007 11:25:44 +1000, "Robert Thorsby"
<[EMAIL PROTECTED]> said:
> On 2007.09.25 11:07 Sonia Hamilton wrote:
> > I'm starting to learn expect [1][2] to help me
> > automate some programs that prompt for input.
> > Expect dates from the early 90s - is it the
> > right way to go or is there now a better shinier
> > tool/language that I should be learning?
> 
> I prefer to use one of the *dialog utilities (ie, dialog, kdialog, 
> gdialog, or -- my dialog-du-jour -- Xdialog) in a shell script and 
> validate the user input in the script. It looks a helluva lot better 
> than expect via a command line. It's prolly also more versatile.

Not sure how *dialogs would help :-)

I want to (as a simple example) update my password on n *nix machines
using the passwd command, which prompts me to enter my old password then
new password twice. With expect I can automatically feed in the old and
new passwords when prompted as passwd is run via ssh on each of the n
machines.

I could also (for example) use awk/perl/tool-du-jour on /etc/shadow on
each machine, but that's nasty, especially across different
Linuxes/SunOSs/versions.
-- 
Sonia Hamilton

-- 
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html

Reply via email to