How to use shellexpect

Source: Internet
Author: User
DonLibes, the author of shellexpect's method of using reverse CT, made the following definitions for reverse CT when he began to write secondary CT in 1990: keep CT is a software suite for Automatic Interaction (keep CT [isa] softwaresuiteforautomatinginteracti shell keep CT use method Don Libes, author of keep CT, made a definition for keep 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: [cpp] #! /Usr/bin/Ct # source/home/rank /. bash_profile set timeout 10 spawn/usr/bin/kinit can. yu yaoct "* OPI. COM * "send" 111111 \ r "exact Ct 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.