How to use shell trusted CT

Source: Internet
Author: User

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


Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.