#!/usr/bin/expect
set machine [lindex $argv 0]
set login [lindex $argv 1]
set passwd [lindex $argv 2]

set flag 1

append login "\r"
append passwd "\r"
append dir "\r"

spawn ftp $machine
expect -re "Name"
send $login
expect "Password:"
send $passwd
expect "ftp>"
send "put answer\r"
expect "226"
send "put semaphoreC\r"
expect "226"
send "bye\r"
