How to (shell) script sftp

Just a small reminder (for myself):

/usr/bin/expect <<EOF
spawn /usr/bin/sftp host.domain
expect "\\n|\\r"
expect "..."
expect "\\n|\\r"
expect "password:"
send PASSWORDXXX\\r
expect "sftp> "
send "ls \\r"
expect "sftp> "
send "bye \\r"
EOF

And read:

man expect

Technorati Tags: , ,

Technorati Tags: , ,

Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>