expect in bash script ? - Dev Archives: "#!/bin/bash
RESULT=`echo 'set timeout -1
spawn ssh someaddress
expect {
Password: {send -- \'mypass\r\'; exp_continue}
user@ {send -- \'dosomething\r\'; exp_continue}
user@ {send -- \'exit\r\'}
} eof | expect -f -`
echo $RESULT
}"
Sunday, December 13, 2009
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment