Automating your FTP session using expect
by Amit
Shamelessly derived from a code on the Wikipedia entry for Expect, here is how you would automate a FTP session:
# Open an ftp session to a remote server, logs in using your credentials and retrieves the current
# directory listing from there
# Amit k. Saha
# This is how you set variables in 'expect'
set remote_server your-ftp-server
set my_user_id your-user-ide
set my_password your-pass
spawn ftp $remote_server
expect "username:"
# Send the username, and then wait for a password prompt.
send "$my_user_id\r"
expect "password:"
# Send the password, and then wait for an ftp prompt.
send "$my_password\r"
expect "ftp>"
# list all the files
send "ls \r"
expect "ftp>"
# Exit the ftp session, and wait for a special end-of-file character.
send "bye\r"
expect eof
Interesting post. I have been wondering about this issue,so thanks for posting. I’ll likely be coming back to your blog. Keep up great writing. Find your great Travel News and sing the songs at Free Song Lyric or you can watch the drama at Korea Drama Online one of great korea drama is A Love to Kill if you go to travel to Indonesia learn Learn Indonesia Language first! And find your home cari rumah or make a blog Belajar membuat Blog find your home again rumah dijual and again at jual rumah the point is cari rumah, jual rumah, rumah dijual, download youtube and find blog widget and then if you want buy a new laptop see the Laptop Price List or you can buy a New Blackberry and then take care your Health & Jewerly good job, very great article Cari Rumah, Jual Rumah, Rumah dijual Thanks ever so much Cari Rumah, Jual Rumah, Rumah dijual very useful article Cari Rumah, Jual Rumah, Rumah dijual Great information Cari Rumah, Jual Rumah, Rumah dijual I like your blog Cari Rumah, Jual Rumah, Rumah dijual I will be checking back for any new articles Cari Rumah, Jual Rumah, Rumah dijual just bookmarked it for later reference Cari Rumah, Jual Rumah, Rumah dijual. Thanks for kindly sharing it with us. Very well done indeed