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:
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
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
Recent project requirements, need to write some shell script interaction, the pipeline is not enough time, expect can be very good to implement the interaction between the script, search for information, found that many articles on the Web are
Expect is a tool built on TCL to automate tasks that require interaction.Because expect is TCL-based, you need to have TCL installed in your systemHow to check?[Email protected] ~]# Whereis tclTcl:/usr/lib/tcl8.4/usr/share/tcl8.4If you do not see
https://www.zhihu.com/question/21418449Mort | Zsh vs. Bash: Incomplete contrast resolution (1) 2014-10-07BdpqlxzWhat's the difference between zsh and bash?A lot of people have written about "why zsh is better than bash", "Why zsh is better than
In shell development, when we connect to FTP or passwd or sudo, we need to enter the password manually. This is obviously inappropriate for automation. And expect's strong interaction model solves this problem. I am involved in this work, the
1, before using expect, need to install two RPM package,
The code is as follows
Copy Code
# RPM-IHV expect-5.43.0-8.el5.i386.rpm# RPM-IHV expect-devel-5.43.0-8.el5.i386.rpm
2, the batch modifies the password
Expect is developed by Don Libes based on the Tcl language and is widely used in interactive operations and automated test scenarios, expect allows shell scripts to automate interactive communication without human intervention.The core function of
usage1. [#!/usr/bin/expect]This line tells the code in the operating system script to use that Shell to execute. The expect here is actually a kind of thing with bash under Linux and cmd under Windows.Note: This line is required on the first line of
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.