1. The first line of the program specifies the program that executes the shell #!/bin/sh #! is used to tell the system that the parameter behind it is the program used to execute the file2. Output information in the consoleecho "Hello
(1) Manipulating a file and slicing the file query rows grep ' XXX ' Cut 2 (or 1-2)(2) The operation of the file to remove the weight and show the number of repetitionsgrep ' xxx ' Cut 2 Sort Uniq -C(3) View total number of totals rowsgrep ' XXX '
"Shell script" line-by-row processing of text filesThe style files are often processed on a line-by-row basis, how to get each row of data in the shell, then process the row data, and finally read the next row of data, loop processing. There are
One, bash variables:Variable naming laws:1. The reserved words in the program cannot be made: for example if, for;2, only use numbers, letters and underscores, and cannot start with a number3. See the meaning of the name4, the Uniform naming rule:
Types of variables in bash1. Local variable: The active scope is the current shell process and is not valid for Shell processes other than the current shell, including the current Shell's child shell processVariable assignment: name= ' value 'Use
How to handle the programming logic:1, sequential execution2, select Execute3, loop executionConditional Select if statementSelect Execute:Note: If statements can be nestedSingle Branchif judgment condition; thenBranch code with true
First, the concept and characteristics of regular expressions:A regular expression is a logical formula for a string operation, which is to make a "rule string" with a predefined set of characters and a combination of those specific characters.This "
The difference between 1, ' and $ ()The anti-quote itself escapes the \, retains its own meaning, and if we want to play a special meaning in the anti-quote, we have to use 2 \ to represent it. So we can simply imagine the inverted quote: \ \ = \$ ()
What is a shell script?Shell script is similar to batch processing under Windows/dos, that is, the use of various commands pre-placed into a file, convenient one-time execution of a program file, mainly for the convenience of administrator settings
Reference article: http://blog.csdn.net/chen_jp/article/details/8922582One-character substitutionOrigin= the original string str= the replaced stringReplace command:str=${origin//the target character / replaced character }For example:str=${origin//:/
1.Tenth LineHow would you print just the 10th line of a file?For example, assume this file.txt has the following content:Line 1Line 2Line 3Line 4Line 5Line 6Line 7Line 8Line 9Line 10Your script should output the tenth line, which is:Line 10----------
SED commandUseProvides the flow editor.Grammarsed [-n] Script [File ...]sed [-n] [-e Script] ... [-F ScriptFile] ... [File ...]DescribeThe SED command modifies the row from the specified File parameter according to the edit script and writes the
I took over two projects, suddenly the eldest brother asked me what configuration of the server, then I was ignorant, has not been too concerned about this thing, just to ensure that the server normal operation, the site can access normal, the other
This is the age of big data!But have you ever thought of yourself as a bowl of big data? Chinese medicine said, talent is the most complex and the most magical natural products, first from the beginning to understand their own ...What do you think
Syntax format((expression))Expression can be any mathematical expression that can contain the following operators:+ Plus-Minus* Multiply (no escaping)/except% take-up* * Index= = equals! = Range> Greater than>= greater than or equal to&& Logic and||
Syntax formatIf Command;thenCommandsFiThe command contains the following:Shell commandAny shell command, if the shell command returns 0, represents true, otherwise, represents false. and multiple command can be used as the judgment condition of if,
1.shell Script InterpreterBourme Shell (/usr/bin/sh or/bin//bin//usr/bin//usr/bin/ for Root (/sbin /SH)Bash is widely used in the development environment because it is easy to use and free2. First shell script#!/bin/"Hello World"#! is a contract tag
Want to test the Elasticsearch operation of cluster mode in Spark-shell,# 1 Download the relevant jar first# 2 Use--jars when starting Spark-shell./bin/spark-shell–master Spark://master:7077–jars/usr/local/spark-1.6.2/lib/elasticsearch-spark_2.10-2.2
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.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service