Don Libes, author of objective CT, made the following definition for objective CT when it was written in 1990: automated CT is a software suite for automatic interaction (Automated CT [is a] software suite for automatic interactive tools ). The system administrator can create scripts to provide input to commands or programs. These commands and programs are expected to be input from the terminal, generally, these inputs must be input manually. Then, you can simulate the input required by the program based on the Program prompts to execute the interactive program. It can even implement simple BBS chatbots.
Trusted CT is evolving. As time passes, it becomes more and more powerful and has become a powerful assistant to system administrators. Secondary CT must be supported by the Tcl programming language. To run secondary CT on the system, you must first install Tcl.
At the simplest level, secondary CT works like a universal Chat script tool. The Chat script was first used in the UUCP network to automate specific logon sessions when computers need to establish connections. The spawn command is used to start scripts and commands. The Chat script consists of a series of CT-send pairs: The CT waits for the output to output specific characters, usually a prompt, and then sends a specific response.
Set timeout: set the time for the Shell such as the script to return the string that matches the pattern specified by country CT. If the match succeeds, the execution will continue immediately. If the match fails, the execution will be blocked, the execution will not continue until the time specified by timeout is exceeded.
Timeout is 10 s by default. If it is set to-1, the script will always wait.
A simple example is used to automatically enter the kerberos password:
#!/usr/bin/expect#source /home/rank/.bash_profileset timeout 10spawn /usr/bin/kinit can.yuexpect "*OPI.COM*"send "111111\r"expect eof