安装Tcl与Expect

Tcl版本:8.6.0;Expect版本:5.45

#cd /usr/local/src    (我的源码包存放在该目录下  )

下载Tcl:

# wget http://nchc.dl.sourceforge.net/project/tcl/Tcl/8.6.0/tcl8.6.0-src.tar.gz

下载Expect:

# wget http://nchc.dl.sourceforge.net/project/expect/Expect/5.45/expect5.45.tar.gz


解压源码包:tar -vxzf 

安装tcl:

进入源代码中unix目录,./configure文件在该目录下面

#cd tcl8.6.0/unix/

设置 ./configure

#./configure --prefix=/usr/local/tcl  (设置安装路径为/usr/local/tcl)

如果配置没有错误,编译安装:

#make

#make test

#make install


安装expect:

设置 ./configure

#./configure --prefix=/usr/local/expect --with-tcl=/usr/local/tcl/lib/ --with-x=no

--with-tcl=/usr/local/tcl/lib/选项很重要,/usr/local/expect为安装路径

expect可执行文件的执行路径为:/usr/local/tcl/bin/expect

为了方便使用,建立软连接

# ln -s /usr/local/tcl/bin/expect /usr/bin/expect
# ls -l /usr/bin/expec 

lrwxrwxrwx 1 root root 25 Mar 28 16:46 /usr/bin/expect -> /usr/local/tcl/bin/expect





你可能感兴趣的:(linux,expect,Tcl)