This file is scripts/README. It describes publicly-contributed Expect scripts in this same directory. (The directory ../example contains another 50 or so of my own examples. This same example directory can also be found in the Expect source distribution itself.) To contribute to this collection, email your shar'd script to expect@nist.gov. Please include documentation. Thanks Don ====================================================================== arlog A very fancy script to automate remote logins. Shows interesting techniques such as getting passwords from an encrypted file. bc Uses bc to do arbitrary precision math. bonfield.exp Solves Jim Bonfield's puzzle that won the 1991 Obfuscated C contest. chat A semi-faithful reimplementation of the popular chat(1) program used by many Unix folks (along with pppd(1)) to dial out a modem and connect to their ISP. dialer start remote net connections with a lot of nice bells and whistles: Try a list of phone numbers, run login script, run arbitrary command, e.g., pppd or term; Has GUI status indicator and configuration windows. eftp ftp client with some frills. ftp-talk-radio Gets "Internet Talk Radio" files from a host. idiff Interactive diff program. Takes two files, runs diff on them, and then prompts for which version of each difference to include in the output. libro-II connect to Libro-II, the NIST library catalog. manymaint Multiple router maintenance program. (Uses autoexpect!) mirror_file Mirror a file from another ftp site, copying file only if changed. mirror_dir Mirror a directory from another ftp site, copying only files which have changed. mx Return any MX records for the given hostname. noidle Run a shell which avoids being 'autologged out' by sending a every hour if no other I/O has occurred. pager.alpha Send a message to an Alpha Pager. pager.mercury Send a message to a Mercury Pager. (Includes some non-essential Perl code which can be ignored - to read data files and call the Mercury pager script.) passwdchk A procedure to verify a password is valid. ping-and-page Ping a list of hosts. If any are down, page the system admin. scripttoggle Records a transcript of a session (like 'script' command) but can enable/disable control of recording on-demand. (Good for avoiding recording of editor sessions, etc.) slip.shar Scripts to keep your SLIP link alive. s-key-rlogin Automate rlogin (or telnet) using s/key su.exp Start up an 'su' and run the argument. Useful when you've mistakenly typed in a command that you needed to be su'd for. term-rlogin Run Term over rlogin. Good for traversing PPP/SLIP or firewall rlogin connections. term-start Start up Term (a sophisticated UNIX-to-UNIX serial line handler). timed-choice Offer user a timed choice of responses. timeout-monitor Monitor a command for inactivity. try-phone-list This script automates logging in to a remote system, trying phone numbers from a list until it finds one that works. waste-collection Contacts NIST service for hazardous waste pickup and removal. There are many more scripts available in the Expect distribution in the example directory. 0, unseen,, *** EOOH *** Path: spln!lex!extra.newsguy.com!lotsanews.com!arclight.uoregon.edu!logbridge.uoregon.edu!newsfeed.stanford.edu!postnews1.google.com!not-for-mail From: k.junk@verizon.net (Kevin VW) Newsgroups: comp.mail.imap,comp.mail.pine Subject: automatically prune folders on an IMAP server Date: 20 Feb 2003 05:54:18 -0800 Organization: http://groups.google.com/ Lines: 39 Message-ID: <6726394d.0302200554.7b7a0e8a@posting.google.com> NNTP-Posting-Host: 129.6.154.85 Content-type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: posting.google.com 1045749258 30445 127.0.0.1 (20 Feb 2003 13:54:18 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: 20 Feb 2003 13:54:18 GMT Xref: spln comp.mail.imap:16107 comp.mail.pine:45175 Here's a very simple way to automatically prune folders on an IMAP server each month. I did this mainly because it is a feature not supported by Pine. The following expect script takes as its only argument the suffix to append to the name of the folders to be pruned. I run this script each month (via crontab) and pass the month-year from `date +%b-%Y`. Of course you should modify IMAP.SERVER.COM, YOUR_ID, and YOUR_PASSWD to reflect yourself. Also, you will probably want to change the folder names that are pruned. In this example, Inbox.Trash and Inbox.sent-mail are renamed and then created. This is a very stupid script, use with caution and common sense. Somebody else can make this script smarter if they want to. Here's the script: #!/usr/bin/expect -f # prune folders on an IMAP server # Written by Kevin Van Workum set date [lindex $argv 0] spawn telnet IMAP.SERVER.COM 143 expect "ready" send ". login YOUR_ID YOUR_PASSWD\r" expect "ged in" send ". rename Inbox.Trash Inbox.Trash-$date\r" expect "leted" send ". create Inbox.Trash\r" expect "leted" send ". rename Inbox.sent-mail Inbox.sent-mail-$date\r" expect "leted" send ". create Inbox.sent-mail\r" expect "leted" send ". logout"