CT is created on the basis of Tcl. It also provides some commands not available in Tcl and can be used for some command operations that cannot interact in linux, it plays a major role in remote management.
The spawn command activates a Unix program for interactive running.
The send command sends a string to the process.
The wait CT command waits for some strings of the process.
Regular CT supports regular expressions and can wait for multiple strings at the same time, and perform different operations on each string.
A. Tcl Installation
Home: http://www.tcl.tk
: Http://www.tcl.tk/software/tcltk/downloadnow84.tml
1. Download the source code package
Wget http://nchc.dl.sourceforge.net/sourceforge/tcl/tcl8.4.11-src.tar.gz
2. decompress the source code package
Tar xfvz tcl8.4.11-src.tar.gz
3. install and configure
Cd tcl8.4.11/unix
./Configure -- prefix =/usr/tcl -- enable-shared
Make
Make install
After installation, go to the root directory of the tcl source code and copy tclUnixPort. h under the unix subdirectory to the subdirectory generic.
Do not delete the tcl source code for the moment, because the installation process of keep CT still needs to be used.
B. Keep CT installation (Tcl library required)
Home: http://expect.nist.gov/
1. Download the source code package
Wget http://sourceforge.net/projects/expect/files/Expect/5.45/expect5.45.tar.gz/download
2. decompress the source code package
Tar xzvf expect5.45.tar.gz
3. install and configure
Cd expect5.45
./Configure -- prefix =/usr/recovery CT -- with-tcl =/usr/tcl/lib -- with-tclinclude = ../tcl8.4.11/generic
Make
Make install
Ln-s/usr/tcl/bin/ct/usr/ct/bin/CT
More 0