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 control structures in all programming languages, and shell programming is no exception. The IF structure is the most commonly used branch control structure.
The most common if statements in Linux Shell programming are: If.....then...fi,if..
Reference: First, the user log into the system after the system environment variables:
$HOME user's own directory
$PATH directory to search for when executing commands
$TZ Time Zone
$MAILCHECK every few seconds to check for new letters
$PS 1 The
Use/dev/null 2>&1 to do this. This command means that the standard output and error output are all redirected to/dev/null, that is, all the information that is generated is discarded.
Here's a look at the difference between command > File 2>file and
EXP detects if there is a SQL injection vulnerability[Email protected]:~# python zabbix.py http://ip:9090/+------------------------------------------------------------+Python zabbixSuccess+------------------------------------------------------------+
1. Signal ProcessingLinux uses signals to communicate with processes running in the system.Signal Value Description1 SIGHUP Suspend process2 SIGINT Terminate Process3 Sigquit Stop Process9 SIGKILL Unconditional Termination processSIGTERM terminate
1. What is the problem requirement?First, the need to come from, mainly to write shell script, with cat for multi-line input redirection, the Terminator must be hyphenation first, the format is not good-looking.2, how? How to solve this
Use of related software:#########################################################################The above is the use of related software! The following is a non-secret landing of the preparationBetween the two servers, the configuration of the
Series article starter platform for Jelly want personal blog. Jelly think, is an original technical article sharing site. Here jelly will share his technical experience, technical gains and losses, technical life. I want to wait for you in jelly,
25, Shell special symbol Cut command, sort_wc_uniq command, tee_tr_split command, Shell special symbol underFirst, shell special symbol Cut commandSpecial symbols*: Wildcard.?: any one character.#: Comment characters, add to command before command
I. Shell environment and features 1.1 what is a shellInterpreter: Responsible for translating and communicating user/program instructions to the kernelInterpreter carShell carBash BMW, Mercedes, Ferrari1.1.1/etc/shellsThe content inside the file is
Purpose: Detects whether the service is running every minute of the day, and if it is running, the name of the process being executed; if it is not running, the current time is loggedShell#!/bin/bashdate=`date
1. Components of Linux1) Linux kernel (kernel)2) GNU tool chain3) GUI/CLI work on several sides (shell)4) application (APP)The main work of the 2Linux kernel:1) Managing Memory2) Management process3) Managing hardware devices4) Managing the file
When you configure the Automatic Updates deployment project in Jenkins, you can turn tomcat off if you take the Execute shell to start/close Tomcat,However, Tomcat could not be started, although the build would show that the execution was successful,
##################################################################################################Shell script:Scripts: Files that can be executed, implemented after running a certain function (command stacking, interactive)Standardize the general
Error in console when executing. SH script: #!/bin/bash:no such file or directoryWorkaround:Cat-a file pathYou'll find the first line is a problem.M-oM-;M-?#!/bin/bash$#----------------------------------$#$# M-eM-^PM-/M-eM-^JM-(M-hM-^DM-^ZM-fM-^\M-,
Shell echo display in script with color display , echo display with color, need to use parameter- e The format is as follows: echo-e "\033[ word background color; text color m string \033[0m" For example:echo-e "\033[41;36msomething here \033[0m"
Origin: In the old boy Linux training shell programming teaching, found a lot of good level of friends and classmates are still very confused, the following for everyone to share the use of the array of small examples, I hope to give you a little
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.