Documenting the shell activity has many benefits, such as the need to monitor user behavior, backtracking before the system crashes. The key tool to implement this function is quite simple, it is COM interface ishellexecutehook. After writing a COM
In the shell script to do a variety of tests frequently, test the format of the statement:
(1) Test
(2) [
(3) [[
Three kinds of differences, in the third can be a wildcard matching, and &&,| |,, the operator can also be normal presence in [[]],
This article mainly introduces the variables in the shell use summary, this article summed up the variable syntax, common use forms and so on, and give the code examples, the need for friends can refer to the
The definition of a variable can only
One, variable operation
A. variable display, printSyntax: Echo $varB. Variable settingsSyntax: Var=value
Setting rules for variables:1. Variable ends cannot be directly connected to spaces2. Variable names can only be letters and numbers, but the
Case statements are used to implement multiple if. else, but the usage is somewhat different, people who have learned other languages know that the case to match the variables, if there is a matching successful words to execute the corresponding
One, the difference between NR and FNR
NR: Represents the current number of recordsFNR: Also represents the current number of records, but the scope of FNR is within only one file. If you reopen the file, FNR starts at 1.
Second, the example
Each language has his own string manipulation method, the shell is the same, the following in an example of the way, a simple introduction of common methods.
1, get string length
Copy Code code as follows:
First, the Shell function
All scripts so far in this tutorial have been executed from beginning to end. This is good, but you may have noticed that some of the script segments are duplicated.
The shell allows a set of command sets or statements to
Let's get to the point. The company now has 2 servers, are CentOS systems, a local (LAN), a computer in the telecommunications room. Because the work needs, the daily backup room data to the local, has been FTP login, and then downloaded to the
In the morning I wanted to upload some photos to the album, but because all the photos have the extension is jpg rather than lowercase jpg, resulting in "malformed" and can not upload photos. The question now arises: how do you use a shell script to
First, CPU information collection
1). Collect CPU Usage rate
Acquisition algorithm: collecting and calculating CPU total utilization or single kernel utilization through/proc/stat file. Taking cpu0 as an example, the algorithm is as follows:1. Cat/
Job Four:
Write a script:
Implement Ping Class C network segment, Class B network segment and all hosts in Class A network segment;
The network segment address lets the user input, moreover uses the script to judge the network segment type;
Here I will first describe what a shell is, and then introduce my first shell program and summarize the experience from it.
First, what is the shell
Before talking about my shell program, I would like to talk to you about what is shell, I believe
In bash, $, * 、?、 [,], ', ', ', \, have special meanings. Similar to the compiler's pre-compilation process, bash, in the process of scanning the command line, will first interpret all the special characters at the text level, and then make the
---restore content starts---File test expression-F file exists and is a normal file-D file exists and is a directory file-S file size is not 0 true-e file exists then true-R file is saved and readable #文件属性对于root有时不好用-W Write-X execution-L exists
First, the Hive function1. Hive Built-in function(1) More content, see "Hive Official Documents"Https://cwiki.apache.org/confluence/display/Hive/LanguageManual+UDF(2) Detailed explanation:Http://blog.sina.com.cn/s/blog_83bb57b70101lhmk.html(3) test
Transferred from: http://www.2cto.com/os/201403/282583.htmlHttp://blog.sina.com.cn/s/blog_bcdac52b0101i2r1.htmlDifferences in concepts such as consoles, terminals, Tty,shell, etc.The use of Linux has been for some time, but it has not been
Tag: Replace pattern match shell variable assignmentShell variable assignment and environmentToday, with the architect (Fan) doing a code-count script, I learned the following:1) command in script, just string, longer command can be changed to
The shell itself is a program written in C, which is a bridge for users to use Unix/linux, and most of their work is done through the shell. The shell is both a command language and a programming language. As a command language, it interprets and
Note: Different versions of Linux will differ, but they are very similarThe Linux command obtains the input from the standard input device (stdin) By default, outputting the result to the standard output device (STDOUT) display. In general, the
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.