1. Find find Pathname-options [-print-exec-ok] & nbsp; Let's take a look at the parameters of the command: The directory path that the pathname Find command is looking for. For example, to represent the current directory,
The method of parameter passing in shell script is commonly used in 8 kinds
1. $# the number of parameters passed to the script
2. $* displays all parameter variables passed to the script in a single string. Unlike positional variables, this
The shell itself cannot be multi-threaded, but it can simulate multithreading by starting the subprocess and putting the child processes into the background, in order to increase the efficiency of the script while not significantly increasing the
First, the preface
Using a proxy server haproxy load balancing for MySQL is a common scenario, to improve availability, when a MySQL problem occurs, such as a server failure, or data replication is interrupted, it is best to let haproxy know
This shell is to determine if the number entered is a reasonable float
The implementation code is as follows:
#!/bin/sh # Validfloat-Tests Whether a number is a valid floating-point value.
# This script cannot accept scientific (1.304E5)
The shell can also use regular group captures, but you cannot capture groupings by using a form such as $ or \1, which can be obtained through array ${bash_rematch}, such as ${bash_rematch[1]},${bash_rematch[n]}Take ip= "121.0.2.2" for example, the
1. Use the shell to "12306 User name and password library-do not use Notepad to open the card will die-after decompression can be used word or ultraedit open. rar" All records genetic SQL statements, and then the SQL into the database into a upwd_123
Two methods
Start a new shell and execute the shell scripts.
Shell scripts at the moment.
The scripts that brings up another shell will be added to the front of the scripts file. #! /bin/shThe first approach is to point out
Previous JMeter Bean shell Use (a) a brief introduction of the bean shell in the next jmeter, this article is a supplement to the above, mainly summarizes the common scenarios and methods, I believe these basic can cover most of the needs. This
Basic concept01:stringAll of the tests in this article, such as no special instructions, are based on fish shellLet's start with the string, what is the string, and we'll look at a few simple examples?> ~ set param ABC? Echo " string with blank and $
Bash's built-in string processing tool:String slices:${var:offset:number}Takes a substring of a string;Take the rightmost few characters of the string: ${var:-length}Note: There must be a white space character after the colon;To take a substring
The SED editor processes the input line by row, and then sends the results to the screen.-i option: Direct Action source file, source file will be modified. sed commands and options:
A\
Add one or more rows after the current line
#!/bin/BashEcho "Please enter the first number"read aEcho "Please enter a second output"Read Bif[[${b}! = *[!0]*]] && [[${a}! = *[!0123456789]* ]]; ThenEcho "Divisor is 0!!!!!!!!!!!!!!!!! "Echo "and for"`Echo$ ((${a} +${b})) `Echo "difference
Explain:1.awk ' nf{a++;p rint a,$0;next}1 ' file4First of all, the existence of the value of NF, the first row of the second row of the third row of the fourth row is present, the output after execution, after the output hit next, the end of the
a few days ago, the seven-ox demo, written with Bash, is a handy script to install, involving path-related judgments, from StackOverflow, plus your own practice. The simple version below is one of the simplest implementations that can solve most of
condition test: Whether the condition of judgment is established1. type of condition test: file test; integer comparison; string comparison; logic test2 . Conditional test Syntax:[ operator conditional expression ] equals test operator conditional
In peacetime, we sometimes encounter the need to change the server administrator password, if the server is more, we can write a script to achieve, save time and effort.Linux uses SSH login need to manually enter Yes to confirm the connection, so
Condition test: Recommended format 2Format 1:test man test See Related HelpFormat 2: [Format 3: [[Description: A wildcard character can be used for pattern matching in [[]] && | | > [[email protected] ~]# test-f file && echo 1 | | Echo 00[[email
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.