This paper mainly introduces several command modules of ansible, including:
command-Execute commands on the remote node
shell-Let the remote host execute the command under the shell process
script-Executes the local script after it
A detailed description of Linux expect usageI. OverviewThrough the shell we can achieve simple control flow functions, such as: cycle, judgment and so on. But for situations where interaction needs to be done manually, we may sometimes need to
Small Q: patriotism means that you are a national of this country, and for this country, it should be compared to otherAll countries have deeper feelings. --George Bernard Shaw=======================================================================A:
Expect:is based onTcla relatively simple language for a free scripting toolused to implement automated and interactive task programs for communication without manual intervention. For example:ssh ftp , and so on, these programs normally need to
Original address: http://www.nginx.cn/1934.htmlWhere the shell script needs to interact with the here document is the implementation, but some commands require the user to manually go on the interaction such as passwd, SCPIt is very painful to
Using expect to implement automatic interaction of shell scripts
It is very effective for complex interactions and even different processing with different screen output.
And the General Linux, Unix have. It's very easy to use and powerful.
Spawn
There are many methods to complete telnet batch processing. Here we can use a TCL/CT script. Next we will introduce this process. This is a simple TCL/terminal CT script to complete telnet to a remote device. Through this example, we can see that it
[TOC]Distribution System-expect What is a distribution system?
Now some of the larger enterprises, most of the use of load balancing, and sometimes because some programs to change, or some bug to modify, if only a few servers, it is very
expect is a program that allows you to "session" with an interactive program in a way that is set in the script content. Depending on the content of the script, expect can tell what content the program prompts or feeds and what is the correct answer.
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.