码迷,mamicode.com
首页 > 系统相关 > 详细

shell脚本 切换用户

时间:2018-07-07 20:30:15      阅读:184      评论:0      收藏:0      [点我收藏+]

标签:用户   color   nbsp   word   shell脚本   rac   expect   send   passwd   

如下:

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

 

shell脚本 切换用户

标签:用户   color   nbsp   word   shell脚本   rac   expect   send   passwd   

原文地址:https://www.cnblogs.com/pinganzi/p/9277704.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!