I am trying to do something basic using expect:
#!/usr/bin/expect -f
# define location variable; will be numeric eg 1234321
v_dir=$(cat /tmp/patch.txt)
spawn sftp [email protected]@server.company.com
expect "password :"
send "Chu6!0ck\r"
expect "patch"
send "cd $v_dir\r"
interact
Basically, I am trying to automate getting a patch from a remote patch server. The patch number is derived from a calling script - now I need expect to read that variable and cd to it.