Exercise one: Write a script 1. Set the value of the variable file to/etc/passwd 2. Say hello to each user in/etc/passwd, and say what the ID is like: (Hint: line= ' wc-l/etc/passwd | Cut-d ""-f1 ') Hello,root,your UID is 0. 3. Count the
(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 '
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 "
1. The array is full of positive integers greater than 0, using the shell to find the maximum, minimum, and average values (2 decimal places reserved)650) this.width=650; "src="
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----------
Set Environment variables:①export variable name = variable Value #设置环境变量② variable name = variable Value #设置环境变量Export variable NameSet #显示当前shell所有变量Env #查看环境变量unset variable name #删除变量Common environment variables:Path variable: Paths to System
In the shell, you can run the script in 3 ways:1. ./script_name or source./script_name2 Direct./script_name3./script_name &Join script Script_name There are two command command1,command2, then, when run in the first way, Command1 and Command2 both
Last Friday operations there was a excle for a mobile phone number, asking for information about all users that correspond to user numbers. This time encountered a problem is that you need to query the number of users, not one to check, and excle in
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||
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