#!/usr/local/bin/sys/expect -f if 0 { From: paisley@central.bldrdoc.gov (Scott W. Paisley 303-497-7691) Date: Tue, 7 Dec 93 17:18:29 MST This script gets the internet talk radio files from a host automatically. All you supply is the host and the file you want. Now some of the top level ftps are different at the different itr archives, but this works for the host I use. I have an aliases which looks like this: alias getitr "$HOME/bin/expect/getitr.exp mojo.ots.utexas.edu \!*" and I run the Expect script like so: % getir 120193_geek Note, I don't have to type in the whole file name. The Expect script uses an mget so that I only need to use a date to get the right file. This also gets the readme file which contains the abstract of the talk. I could even set this up in cron so that I can get the files on their weekly debuts! Here's the script... } log_user 0 set timeout -1 set host [lindex $argv 0] set file [lindex $argv 1] while {1} { spawn ftp $host expect "Name" send "anonymous\r" expect "Password:" send "paisley@bldrdoc.gov\r" expect "Login failed." {send "quit\r";close;wait } \ "ftp> " break } send "cd pub/itr\r" expect "ftp> " send "bin\r" expect "ftp> " send "prompt\r" expect "ftp> " send "mget $file*\r" expect "ftp> " send "quit\r"