- 论坛徽章:
- 0
|
部分代码:
#Check whether the login is correct
ssh $login@$host << EOF > $$ssh.log 2>&1 &
exit
EOF
#sleep 6 seconds, if the ssh connect process still exists, kill the process, send out an error message
sleep 6
sshpid=`ps -ef|awk '$2==search' search=$!|awk '{print $2}'`
if [ "x$sshpid" != "x" ]
then
kill -9 $sshpid
exit 1
fi
现在的问题是,脚本退出来后当前的terminal有点问题,不管输入什么都不显示,回车的话是这样在一行上:
dstibm19_appadm> dstibm19_appadm> dstibm19_appadm>,
而不是另起新的一行。
但是如果是直接kill $sshpid,退出就正常,不知道为什么。这里用kill -9只是为了安全考虑。
请教大牛帮忙解答一下,多谢。 |
|