Expect is a great utility for automating sys-admin tasks. It's been on my to-do list for learning for some time now. I've seen it used by one of the admins where I used to work and was amazed at what it can handle.
To quote the Expect website, "Expect is a tool for automating interactive applications such as telnet (ssh), ftp, passwd, fsck, rlogin, tip, etc. Expect really makes this stuff trivial. Expect is also useful for testing these same applications."
O'Reilly books has a great book on the subject, Exploring Expect, and has been a title I have been searching for, but this year
it's high on my wishlist I got it for Christmas.
Expect is based on the Tcl ("tickle") scripting language, combined with the Tk extensions, Tcl itself is pretty nifty. Here's one example of what you can do with Tcl/Tk. (and that's one example i use quite a bit when i'm at a console!)