shell脚本 切换用户

如下:

#!/usr/bin/expect -f
spawn su root
expect "Password:"
send "mypasswd\r"
interact

 

posted @ 2018-07-07 16:45  圆旭  阅读(1983)  评论(0编辑  收藏  举报