#函数: Must be defined before using#格式:#function_name () {# List of commands# [return value] #可以显示增加return语句, if not added, the last command runs the result as a return ##返回值只能是整数, generally used for function execution success or not, 0 for success,
Shell IntroductionThe shell is the user interface of the system and provides an interface for users to interoperate with the kernel. It receives the command entered by the user and feeds it into the kernel to execute.Running backgroundA basic Linux
The actual combat target for the log desensitization, the log directory of all the files processed, all involved in the card number and password information, will be replaced by "*" number, to replace the contents are obtained from the corresponding
1. Regular and wildcard characters
The wildcard characters in Linux are used to match the file names, and their matches are exact matches. Only wildcard characters are supported, command has LS find CP and other commandsThe regular is used to match
a.expr normal addition multiplication operation Note: Expr can only perform integer operationsExpr 2 + 2Expr 2-2Expr 2 \* 2Expr 2/2Attention:1. Operators and calculated numbers have at least one space around them2. Using multiplication sign, you
Commonly used arithmetic operators, assuming that variable A is 10 and variable B is 20:Operator Description Example+ addition ' expr $a + $b ' result is 30.- subtraction ' expr $a-$b ' result is 10.* multiply ' expr $a \* $b ' result is 200.
Reprinted from: http://www.cnblogs.com/sunddenly/p/4031881.html2.1.1 Zookeeper Command ToolAfter you start the Zookeeper service, enter the following command to connect to the Zookeeper service:
Zkcli.sh-server localhost:2181
After
ReferenceHttp://www.cnblogs.com/ggjucheng/archive/2012/10/21/2733028.htmlAdd a & after the command, such as Firefox &: Background execution.Jobs-l command lists How many commands are currently running in the backgroundCTRL + Z or send signal 17:
1. Read reading variables from the keyboard 2. Declare/typeset declaring variable typesA. The-i option of the DECLARE command specifies that the variable is an integer type (the default is a string) B. The-X option of the DECLARE command specifies
Shell annotations1. Single-line CommentLines that begin with "#" are comments, which are ignored by the interpreter.debian:/# Vim first.sh#!/bin/sh#This is my first shell (this line is a comment)echo "Hello World"2. Multi-line annotationsThere are
Types of variables for bash本地变量(局部变量)环境变量位置变量:$1,$2,$3, ...特殊变量:$?,$#,$*,[email protected]The location variable that gives the script the ability to get external parameters,$1 for the first argument,$2 for the second argument, and so onCases:vartest.
If you have been exposed to the C language, you should know that the C statement is executed when the error editor will indicate the specific error in that line, of course, these errors are the machine can not be executed error! Unfortunately our
Position parameters can be usedShiftcommand to move left. Like whatShift 3said the original $4 now become $ $ , the original $ $ now becomes $ $, etc., the original $, $, $ discarded, don't move. The shift command with no parameters is
1. SortA. Sorting strings by default B. With-r option: Reverse sort C. Specify the option data field separator with-T, and the-K option specifies the data field to compare D. Use the-N option to specify "pure digit sorting". As can be seen in the
1. DefinitionThe Hill sort (Shell sort) is a sort of insertion. Because of D. L The shell was named after it was introduced in 1959.2. Basic IdeasFirst, take an integer less than n D1 as the first increment, dividing all the records of the file into
This article mainly describes how to use bash to implement a basic thread pool.1. Pre-knowledge
{}& in Linux means the entire block of code is put into the background execution
The wait Wait command indicates that all background
Suddenly want to find a place to write a little article, and think of this old account, not because of the long-term silence was deleted is very touched ... All right, let's just commemorate this. First day.I suddenly wanna write something and
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