I have the following expect script to automate a simple ftp transfer
but it doesn't take the '$1' from the command line for some reason.
Anyone know how I could get it to do that?
--------------------------------------------------
#!/usr/bin/expect
#
#
#set prompt "(%|#|\\$) $" ;# default prompt
#catch {set prompt $env(EXPECT_PROMPT)}
eval spawn ftp ftp.eskimo.com
interact -o -nobuffer -re ftp.iglou.com:root return
send "oak\r"
interact -o -nobuffer -re assword: return
send "mypassword\r"
interact -o -nobuffer -re ftp> return
send "put"
send $1\r"
interact -o -nobuffer -re ftp> return
send "bye\r"
#interact -o -nobuffer -re $prompt return
interact
--------------------------------------------------
All I get is the follow error:
ftp>can't read "1": no such variable
while executing
"send $1..."
Thanks,
-Tony