Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有这个脚本:
expect -c "spawn ssh $sshUserName@$ipTestLion; expect \"*?asswor?:*\" {send \"$sshUserPasswort\\r\"; interact};" < $path2script/sshEvents.sh
这行不通。有人知道为什么吗?
尝试在交互之前添加另一个期望:
expect -c "spawn ssh $sshUserName@$ipTestLion; expect \"*?asswor?:*\" {send \"$sshUserPasswort\\r\"; expect \"*:~*\" {interact;};};" < $path2script/sshEvents.sh
还要确保您有权在其中创建文件/Users/admin/Test/并且该目录存在。
/Users/admin/Test/