In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-06 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/02 Report--
Expect is a Linux operating system to deal with interactive operations, the system default is not installed expect library, so the execution of expect will prompt not to find the command, need to install manually, other installation is relatively simple, you can compile configuration through binary source code package installation, you can also install through the network with the help of yum source, yum source installation is relatively simple; We use the Expect library to implement Linux interactive automatic operation and maintenance operations. We only need to execute scripts to implement automatic operation and maintenance operations. We do not need to manually enter some information. Press OK. We can write the interactive process on a script to automate it. We can use Expect to achieve SSH automatic login, FTP automatic login, automatic file transfer, automatic user creation and deletion, etc., all in line with interactive automated operation and maintenance. Here are some examples to illustrate the results. We introduce four basic commands through the following commands.
Linux is still widely used in enterprises, and expect is a free programming tool language for automated and interactive tasks to communicate without human intervention. Expect is constantly updated, with the passage of time, its function is more and more powerful, have a basic understanding of Linux know this command, and Linux operating system administrator is an essential command, commonly used shell scripts need to use this tool, can save a lot of operation time, conducive to improve work efficiency, if you don't know much about Linux can go to the shopping platform to search Liu Trent teacher's "Linux should learn this way" book to learn, Book content is more suitable for beginners, there are many cases more suitable for some common operations of enterprises, expect needs Tcl programming language support, to run expect on the system must first install Tcl.
We use yum source to briefly introduce which libraries to install under expect. If you want to install them through binary tar.gz package, you need to download the expect.tar.gz installation package, which will not be introduced here. The operation is as follows:
# yum install expect.x86_64 expect-devel.x86_64 -y
The four most critical commands in expect are: send,expect,spawn, and interact.
1. send: used to send a string to a process;
Expect: Receive a string from a process;
Spawn: Start a new process.
Interact: Allow user interaction;
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 227
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.