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.
我有以下使用 rsync 并期望自动化该过程的期望脚本。
#!/usr/bin/expect rsync -a --progress --delete --rsh='/usr/bin/ssh' root@00.00.00.00:/var/www/test/ /var/www/test expect "password:" send "XXXXX"; interact
但是 rsync 命令当然不能在期望脚本中工作。任何解决方法的想法?
正如 Raphael 已经意识到“在 rsync 解决问题之前添加“spawn””
接得好!