Reference: Keep ct tcl Installation
A. TCL Installation
Home: http://www.tcl.tk
: Http://www.tcl.tk/software/tcltk/downloadnow84.tml
Http://download.csdn.net/detail/koala002/3853393 (csdn)
1. Download the source code package
Wget http://nchc.dl.sourceforge.net/sourceforge/tcl/tcl8.4.11-src.tar.gz
Wget http://nchc.dl.sourceforge.net/sourceforge/tcl/tk8.4.11-src.tar.gz
2. decompress the source code package
Tar xfvz tcl8.4.11-src.tar.gz
Tar xfvz tk8.4.11-src.tar.gz
3. install and configure
CD tcl8.4.11
CD 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/
Http://download.csdn.net/detail/koala002/3853396 (csdn)
1. Download the source code package
Wget http://expect.nist.gov/expect.tar.gz
2. decompress the source code package
Tar xfvz expect.tar.gz
3. install and configure
Cd ct-5.43
./Configure -- prefix =/usr/recovery CT -- With-tcl =/usr/Tcl/lib -- With-tclinclude =
/TCL source code path/generic
Make
Make install
Simple Example:
# Automatic Logon Program
#! /Home/jyq/bin/Tcl/bin/CT # Set ipset host 219.219.216.76 # Set username Set Name jyq # Set Password XXX # spawn SSH login process spawn SSH $ host- L $ nameshortct {"(Yes/No )? "{Send" Yes \ n "Expect CT" Password: "send" $ pasword \ n "}" Password: "{send" $ password \ n "} interact