Condition test(a) Concept: to determine the specific conditions to determine how to perform the operation, when the condition is set, the return value of the test statement is 0, otherwise, the other value, meaning if the echo $? The value is 0,
The server side looks at the log shell script (where path1 and path2 are replaced with the path feature name, and the path followed by "Tail-f" is replaced with the log file path for the path feature name):#! /bin/SH#Check log.Echo "which path
CutThe Cut command extracts text columns from a text file or text stream.Cut grammar[[email protected] ~]# cut-d ' The delimited character '-f fields options with Parameters: -D: followed by delimited characters. Use with-F; -F: Divides a piece of
Linux a simple Execute command shell script per second 2012-08-06 11:47:06Category: Python/rubyA server was migrated last week, the data of one of the items is not updated, the data of the original server is queried, the data is updated, the Rsync
;Semicolon, which is used to split multiple commands, each command executes sequentially, but there is no logical relationship between multiple commands, only sequentially (that is, even if the previous command execution fails, it does not affect
In the daily maintenance of Linux, Shell script is one of the essential daily management, its role is to solve the automatic maintenance of the server, reduce the workload of the Administrator, if you want to improve the speed of writing shell
awk '/5/{a=1}!a ' file2Results:1234Explain:The first line/5/does not match skip {a=1}, continue to!a, at which point a no value belongs to the false take reverse to true, so the first line of outputThe second line/5/does not match skip {a=1},
When you replace characters in text with SED, you accidentally add a Chinese double quotation mark when the character is added, and when the result is replaced, you cannot always replace it.The file name is called A.txt and the text reads as follows:
1. Read a row of data using the Read commandWhile read Mylinedo echo "line:" $mylinedone 2. Read a row of data using the Read commandCat Datafile.txt | While read Mylinedo echo "line:" $mylinedone3. #读取一行数据Cat Datafile.txt | While myline=$ (line)
Scenario: Fake tune There are several files like this in your directory1.jpg?v=12.jpg?v=23.jpg?v=34.jpg?v=4What if the v=x of the file is removed?Method One: Direct write command implementation using AWK shell command implementationls | awk ' {split
Reference parameters
Describe
0,1,2.
Positional parameters. Start with the parameter 0. The parameter 0 references the name of the Startup bash program, and if the function runs in the shell script, the name of the shell
Open a text editor, create a new file, the extension sh (sh for Shell), the extension does not affect the execution of the script, see the name is good, if you write a shell script in PHP, the extension is good with PHP.Enter some code:
There are two directories A, B, two folders directory of some files are the same name, but the suffix is different, I want to a folder and B folder with the same file name of the files covered to B, and delete the name of B and different suffix file,
1. Bash = Bourne Again SHell2. Terminal prompt:#普通用户 [email protected]$ #管理员用户 [email protected]#3. The shell script is usually a text file that starts with Shebang:#! /bin/bashShebang is a line of text where #! is before the interpreter path.
PS: In the Linux system-based STM8 firmware upgrade project, you need to let the CPU through the I²C bus to STM8 transfer data, just start one of the knock, a waste of time, and then consider the shell script, although the shell script is very
The company recently built Jenkins on Windows, but the release was published to a Linux server, so there will be a problem with executing the shell command on the automatic deployment, and then looked for it;Discover that Jenkins has a plugin for
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.