In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-14 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/02 Report--
This blog structure Expect overview Expect installation method Expect basic commands Expect execution Demo instance Expect overview
Expect is an automated script interpretation tool. It is based on tcl scripts and requires the support of tcl to run. Expect is useful for commands that need to be entered interactively, such as ssh ftp scp telnet.
When logging in to the linux server remotely, the ssh command needs to enter the password manually, which is very cumbersome when logging in to multiple machines. Expect can automatically input the password for us according to the set rules, which saves a lot of time.
Expect installation method
Usually, expect is not installed on the system and needs to be installed manually
When the system is Centos:
Yum install expect-y
Expect basic command
Timeout: specifies the timeout. Default is 10s.
when timeout-1 means never time out
Send: sends a string to the process to simulate user input
usually changes lines with the "\ r" representative.
Spawn: start the process and track subsequent commands
Expect: capture processes (only processes started by spawn)
determines whether the specified string is included in the last output.
Interact: return control to the console
$argv parameter array: accepts parameters passed from bash
The parameter starts at 0 and represents the first parameter.
Expect execution mode
There are two main modes of execution: direct execution in the expect interpreter and combination of "
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: 0
*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.