[root@centos6 ~]# rpm -qa | grep tcl #检查是否安装tcl
[root@centos6 ~]# rpm -qa | grep expect #检查是否安装expect
[root@centos6 ~]# yum install tcl expect #用yum来快速安装
Resolving Dependencies
--> Running transaction check
---> Package expect.i686 0:5.44.1.15-2.el6 set to be updated
---> Package tcl.i686 1:8.5.7-6.el6 set to be updated
--> Finished Dependency Resolution
。。。。。。#此处省略。。。。。。
Installing : 1:tcl-8.5.7-6.el6.i686 1/2
Installing : expect-5.44.1.15-2.el6.i686 2/2
Installed:
expect.i686 0:5.44.1.15-2.el6 tcl.i686 1:8.5.7-6.el6
Complete!
--------------------------------------------------#yum 结束
[root@centos6 ~]# whereis kibitz #检查软件包
kibitz: /usr/bin/kibitz /usr/share/man/man1/kibitz.1.gz
[root@centos6 ~]# tty #检查时那个console
/dev/pts/0 #当前是pts/0
[root@centos6 ~]# w #看下当前有几个登录用户
20:07:50 up 1 day, 16:11, 3 users, load average: 0.10, 0.50, 0.42
USER TTY FROM LOGIN@ IDLE JCPU PCPU WHAT
root pts/0 192.168.0.100 19:57 0.00s 0.08s 0.01s w
root tty1 - 19:45 10:50 0.12s 0.12s -bash
root pts/1 192.168.0.100 20:05 12.00s 0.03s 0.03s -bash
[root@centos6 ~]# kibitz -tty pts/1 root #向pts/1的root用户发起请求
asking root to type: kibitz -23701
---------------------------------------------------------------------------
下面是在另外一个shell console下面:
[root@centos6 ~]# tty #检查下当前的tty,是pts/1
/dev/pts/1
[root@centos6 ~]# #这个时候,pts/0发起请求
Message from root@centos6.localdomain on pts/0 at 20:08 ...
Can we talk? Run: kibitz -23701 #至此是pts/0发起请求,pts/1还没有任何操作
EOF # 我们需要把上面kibitz -23701 粘贴在下面
kibitz -23701 #这个是粘贴的,然后回车
Escape sequence is ^]
[root@centos6 ~]#
上面是粘贴kibitz -23701 后的现象。
——————————————————————————————————————————————
[root@centos6 ~]# kibitz -tty pts/1 root
asking root to type: kibitz -23701
Escape sequence is ^]
[root@centos6 ~]#
|