linux shell 切换到ROOT用户

#!/bin/bash 
expect -c "
        set timeout 1000
        spawn /bin/su - root 
        expect ":"
        send "12360.cn "
        interact 
"
原文地址:https://www.cnblogs.com/lvdongjie/p/4211709.html