What are positional variablesCalls the arguments passed to the script through the command line in the script code.What are the positional variables$1,$2,...: Corresponding to the 1th and 2nd parameters, Shift [n] position $: The command itself $*:
Condition test1. Test condition tests or [] (test conditions are true false)
Example: string comparison#!/bin/bashRead dataTest "$data" = = "Hello" //note there are spaces on either side of the equal sign or [$data = = "Hello"] echo $?
Brief description of single quotes, double quotes, and unquoted
Name
Explain
Single quotation marks
What you see is what you get: Everything inside a single quote is output as it is, or what you see in single
Shell script ProgrammingThe history of programming languages: Machine language--Assembly languages--high-level languagesCategories of programming languages:(1) According to the operating modeStatic language: Compiled language, pre-converted to
Recently do the computer room bandwidth detection. Recently wrote a shell script to ping the IP of the machine room in bulk, returning the failure rate and the average response time#!/bin/bashlog=$1.logecho-n "" > $logfor i in ' Cat $ do/bin/ping-s 1
The basis of a simple progress bar1. ArraysBash supports one-dimensional arrays (which do not support multidimensional arrays) and does not limit the size of arrays. Similar to the C language, the subscript of an array element is numbered starting
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
String interception of Linux is useful. There are eight ways.Suppose there is a variable var=http://www.aaa.com/123.htm.1. # Intercept, delete the left character, leave the right character.echo ${var#*//}where Var is the variable name and the # is
From http://www.cnblogs.com/wang-li/p/5728461.htmlLinux ops shell script gadget, if you want to share this article, please indicate the source of the article, the following script is for reference only, if the error placed on the server, the
1. Condition testing: Test or [If the test result is true, the exit status of the command is 0, and if the test result is false, the exit status of the command is 0Operation Result:Test commands with and, or, not[ ! Expr]: Expr can be any of the
The Shell function is to explain the execution of the user's command, the user enters a command, the shell explains the execution of this article, this method is called interactive, but there is another way to execute the command is called batch
Condition testThe command test or [can test whether a condition is true, if the test result is real, the exit status of the command is 0, if the test result is false, the exit status of the command is 1 (note the exact opposite of the logical
VariableDefining variablesYour_name= "Runoob.com" #变量名和等号之间不能有空格Using variablesYour_name= "QINJX"Echo $your _nameEcho ${your_name}echo "I am good at ${skill}script"echo "I am good at ${skillscript}"Curly braces are added to help the interpreter
Simple comprehension: Use many tools to simplify complex steps in a shell scriptFrame: Must have notes, written by others can understandBeginning: #! The/bin/bash means that the file is using bash syntaxTo use this method to run a shell script, if
ExplainRedirect: Is an action, an Operation action actionFile descriptors: Nouns, another representation of a file, Linux everything is file."Base redirection form"
Input redirect
Usage Rating: * *
The Shell's handling of the problem is simple, but most of the online search is done under Linux. As follows:
Sed-i ' s/[match string []/[Replace string]/g ' [filename]
And my system is MacOS, using this command has been unsuccessful, are
Topic linksDp[n] = Sigma (A[i]*dp[n-i]), given a1.....an, Dp[n]. N is 1e5.The form of this equation is obviously a convolution, so you can use the FFT to optimize it, but this will also time out. So you can use the CDQ to optimize the partition.CDQ
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.