shell脚本 切换用户

如下:

#!/usr/bin/expect -f
spawn su root
expect "Password:"
send "mypasswd
"
interact
原文地址:https://www.cnblogs.com/pinganzi/p/9277704.html