Description
TAC and Rev are not necessarily connected, the only same is that they are "villains". TAC is actually cat's reverse write, cat normal output, the TAC is inverted output, but the last line from the line output, that Rev? Rev is the last
Description
Cut press the column to split the file and you can specify the delimiters for each column. In cut terms, each column is a field, sometimes the first column, which may be described as the first field.
Actual combat:
Suppose there is a
1. Examples of error methods
A
Var=1+1
Echo $var
The result of the output is 1+1, tragedy, hehe
b
Var=1
var= $var +1
Echo $var
The output result is 1+1, still tragic, hehe
2. The correct method
1) using Let
Var=1
Let "Var+=1"
Echo $var
The output
Copy Code code as follows:
#!/bin/sh
Mypath= "/var/log/httpd/"
Myfile= "/var/log/httpd/access.log"
#这里的-x parameter to determine whether $mypath exists and has executable permissions
if [!-X "$myPath"]; Then
mkdir "$myPath"
The awk function split (S,A,SEP) splits a string s into a awk array a using the delimiter Sep.
Set time = 12:34:56Set hr = ' echo $time | awk ' {split ($0,a, ":"); Print a[1]} ' # = 12Set sec = ' echo $time | awk ' {split ($0,a, ":"); Print A[3]} '
How to identify the number of physical CPUs, a few cores, is hyper-threading or multi-core
Judge the basis:
1. CPUs with the same core ID are the same core hyper-threading.2. CPUs with the same physical ID are the same CPU-encapsulated threads
Linux system is a multi-user multi-task operating system, any one to use system resources, users must first to the system administrator to apply for an account, and then the identity of the account into the system. The user's account can help the
In the process of sorting out the word library encountered a problem, some are actually the same keyword with a space, can not be normal to be heavy, then there is no way to quickly remove these characters in the middle of the space? After Baidu
In general, we only need to monitor the program process in the not on it. But this time, the company developed the program, the process is still in, but the deadlock. Lead to a wide range of effects, but even more importantly, do not know where the
Array as a data structure, in some high-level languages are directly provided and implemented, of course, my shell is also some ha.
PS: This article is written because brother B in the group sent a screenshot:
My big B elder brother is still
The recent systematic study of the shell function, the overall sense of the root of the other language function is similar, but it also has its own characteristics
One, the call function must be defined after the function, or it will be the error
This section mainly discusses the mathematical related shell script programming.
Addition operations
Create a new file "addition.sh", enter the following and give it executable permissions.
Copy Code code as follows:
#!/bin/bash
When you write a shell script on a Linux operating system, we use the $ symbol in front of the variable to get the value of the variable, usually in the script using the "$param" in a double quote format, but there are also the use of the ' $param '
Especially in today's various browsers are flying (it is said that only IE is the kernel of the browser there are 200 kinds of).
Little brother today wrote a jquery based plug-in extension that identifies the type and version of the browser's kernel
#!/bin/bash
#-------------------------Haproxy Server Management Shell script------------------------------------------------
#Authors are from JC
#time: 2012-10-10
#QQ: 408822635
#from the region Beijng.china.
#-------------------------Haproxy
The printf command is used to format the output and is an enhanced version of the echo command. It is a finite variant of the C-language printf () library function, and is somewhat different in syntax.Note: printf is defined by the POSIX standard,
We started the Shell Script debugging series, first explaining the different debugging options, and here's how to enable Shell debug mode.After you finish writing the script, it is recommended that you check the syntax in the script before running
Empty shell Mail 650) this.width=650; "src=" Http://img.baidu.com/hi/jx2/j_0057.gif "alt=" J_0057.gif "/>1. Meaning of introducing empty shell messagesMail server directly exposed in the network environment, Security will be greatly reduced, so the
Shell basic applications and examplesOne$# the number of arguments to the script$* displays all parameters passed to the script in a single string. Unlike positional variables, this option parameter can be more than 9$$ the current process ID number
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.