阅读背景:

派生:在linux脚本中没有找到的命令

来源:互联网 
[tibco@c0040229 ~]$ cat test.sh.5
#!/usr/bin/expect

echo -n Enter User Id:
read userid

echo -n Enter Password for remote user:
read -s password

hostname=`hostname`
spawn ssh ${userid}@$hostname

expect "Password: "
send "${password}\r"
expect "$ " { send "pbrun su - tibco\r" }
expect "$ " { send "exit\r" }
expect "$ " { send "pbrun bash\r" }
expect "$ " { send "ps -ef |grep apache\r"
expect "$ "
send "exit\r"
[tibco@c0040229 ~]$ cat test.sh.5
#!/usr/bin/ex



你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: