On Tue, 2007-09-25 at 12:56 +1000, Sonia Hamilton wrote: > 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.
expect is still a good, reliable tool that gets a lot of use. My only issue is that it's written in Tcl. But most of the current crop of scripting languages have a module to emulate expect behaviour. Depending on your needs, using one of these might be a more pleasant option. For python, I quite like pexpect. And in great SLUG tradition, I'm going to offer a suggestion that you definitely didn't ask for; something else to consider, especially for jobs like the one you describe, is using a tool like multixterm which uses expect to launch a number of terminals and control them all together. -- Pete -- SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/ Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html