Robert, by explanation and driven by the context of the original poster,
they are a different use-cases.

 "*dialogs" are very useful when the "user" entering the commands is
sitting on the outside of the glass. It makes it easy to write a simple
unambiguous user interface

 "expect" and their ilk are useful when the "user" is in fact a program,
and hence is trying to drive the the input interface of aanother
program, emulating a flesh-ware user.

Sonia, when I last had to do something like this I ended up using the
Net::Telnet module for Perl - for that project I was interrogating
routers and other network equipment for their firmware revisions for a
Y2K audit. Today I would probably use Expect.pm for Perl or Pexpect for
Python.




Martin Visser

Technology Consultant 
Consulting & Integration
Technology Solutions Group - HP Services

410 Concord Road
Rhodes NSW  2138
Australia 

Mobile: +61-411-254-513
Fax: +61-2-9022-1800     
E-mail: martin.visserAThp.com

This email (including any attachments) is intended only for the use of
the individual or entity named above and may contain information that is
confidential, proprietary or privileged. If you are not the intended
recipient, please notify HP immediately by return email and then delete
the email, destroy any printed copy and do not disclose or use the
information in it.

 
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On
Behalf Of Robert Thorsby
Sent: Tuesday, 25 September 2007 1:26 PM
To: [email protected]
Subject: Re: [SLUG] expect - more modern tool available?

On 2007.09.25 12:56 Sonia Hamilton wrote:
> On Tue, 25 Sep 2007 11:25:44 +1000, "Robert Thorsby"
>> 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, ... . 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.

I do not understand how you can't do this with *dialogs. But, whatever
floats your boat.

Robert Thorsby
--
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html
--
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