For an even number of 100 or lessIdea: 1. Define a variable x firstThe range of 2.x is 0-50,x with an initial value of 13. And the value initial value is 0, each time the loop and the value is equal to itself +2*iMethod One:Vim
Shell expressionWhether the-D file exists and is a directoryThe-f file is present and is a normal fileWhether the-W file file exists and is writable-s file exists and is not empty-N string string length not 0String1=string2 string Equality-eq equals-
The company now needs to make regular backups of the existing servers and place the backup files in the NAS being used;For the efficiency of backup, we also need to filter the backup files and exclude some files with suffix names.The implementation
Shell is the core program kernel outside the instruction parser, is a program, colleague is a command language and programming language--shell is a command parser, the user Input command, it to parse.Shell type ash,bash,ksh,csh,tcsh--cat
1. Define variables: In order to avoid conflicts with environment variables, generally lowercase: such as pp= "mydql,kdkfeof";Second assignment scheme:The calling variable uses the $ symbol:Variable overlay:2. The output uses ECHO, as shown in:3.
The common input and output operators under the Linux shell are:1. Standard input (stdin): code 0, using 2. Standard output (STDOUT): Code 1, using > or >>/dev/stdout,/PROC/SELF/FD/1 1 for:/dev/stdout3. Standard error Output (STDERR): Code 2, using 2
Condition test(a) Concept: to determine the specific conditions to determine how to perform the operation, when the condition is set, the return value of the test statement is 0, otherwise, the other value, meaning if the echo $? The value is 0,
CutThe Cut command extracts text columns from a text file or text stream.Cut grammar[[email protected] ~]# cut-d ' The delimited character '-f fields options with Parameters: -D: followed by delimited characters. Use with-F; -F: Divides a piece of
Ctrl + A cursor moves to the beginning of the lineCtrl + E cursor moves to end of lineCtrl + R Search in the history commandCtrl + L Clear ScreenCtrl + U Clear the cursor to the beginning of the characterCtrl + K Clears the character of the cursor
;Semicolon, which is used to split multiple commands, each command executes sequentially, but there is no logical relationship between multiple commands, only sequentially (that is, even if the previous command execution fails, it does not affect
Accessing HBase, and manipulating hbase, commands do not use semicolonsHBase Shell enters HBaseList View TableHBase shell-dHBase (main):024:0> scan '. META. '============= Small Example ===================================================1. Create a
Input and output in the shellStandard input: KeyboardStandard output: Terminal displayThe >> append is a newline appendEcho- n do not trailing line breaks-e enable escape function to interpret backslashes-e disables the escape function that
When you replace characters in text with SED, you accidentally add a Chinese double quotation mark when the character is added, and when the result is replaced, you cannot always replace it.The file name is called A.txt and the text reads as follows:
1. Read a row of data using the Read commandWhile read Mylinedo echo "line:" $mylinedone 2. Read a row of data using the Read commandCat Datafile.txt | While read Mylinedo echo "line:" $mylinedone3. #读取一行数据Cat Datafile.txt | While myline=$ (line)
/*** Setup window is located in the middle of screen* @param the Shell to adjust the position of the Window object*/public static void Center (shell shell){Get screen height and widthint screenh = Toolkit.getdefaulttoolkit (). Getscreensize ().
Condition test:To determine whether a demand is satisfied, it needs to be realized by testing mechanism;How to write a test expression to implement the required tests:(1) Execute the command, and use the command status return value to judge;$?:
If you want to find common commands, please click on the imageThe instructions in the shell script, in the uncertain case, do not arbitrarily use nohup, otherwise it may have disastrous consequences, such as-memory explosionShell random function
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