This one time, at band camp, Sonia Hamilton wrote:
>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.

So for example you could use clusterssh or distributed ssh; dsh or cssh
packages in Debian, for example, which are quite sweet for doing the same
interactive thing on a bunch of machines (with the caveat that if your
machines have varying latencies then you might have to wait a long time
between commands to get them all in sync).

Alternatively, run passwd on one box and then use perl or sed to replace the
password hash in place on /etc/shadow like you said ;-)  You can probably
make a one-liner that does this nicely :)
-- 
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