osx - SSH host < script.sh - not work with expect -
i have script:
expect -c "spawn ssh $sshusername@$iptestlion; expect \"*?asswor?:*\" {send \"$sshuserpasswort\\r\"; interact};" < $path2script/sshevents.sh
this doesn't work. know why?
try add expect before interact:
expect -c "spawn ssh $sshusername@$iptestlion; expect \"*?asswor?:*\" {send \"$sshuserpasswort\\r\"; expect \"*:~*\" {interact;};};" < $path2script/sshevents.sh
also make sure have permission create file in /users/admin/test/
, directory exists.
Comments
Post a Comment