Transferred from: http://blog.sina.com.cn/s/blog_464f6dba0100psy9.htmlVariable Description:$$The PID of the shell itself (ProcessID)$!PID of the Shell's last running background process$?End code of the last Run command (return value)$-Flag at a
wrote a script to automatically generate PDF uploads GitHub can't stand every time the same commit decides to use a script to pass the argumentSimple and easy to use bold method, more complex can refer to the following two detailed.How to pass
VIEditoris the standard for all UNIX and Linux systemsEditorThat it's powerful not inferior to any of the latest textEditor, here is simply a brief introduction to its usage and a small number of instructions. Because of any version of UNIX and
SummaryThis chapter describes how to use ls and stat to expose files and file meta data , and how to use Touch set the time stamp not seen . Touch can display information about datetime and scope limitations on many existing systems .Shows how to
1.sh-x ScriptThis executes the script and displays the values of all variablesFor example, script:#!/bin/bash#a test about shiftif$#0 ]thenecho"there is no parameters"exit0fisum=0while$#-gt0 ]do $sum$1` shiftdoneecho$sumOutput:2.sh-n ScriptDo not
Directly on the script,Use $ (()) and $[] for numeric calculationsNumerical comparison:N1-eq n2 Check if N1 equals N2 n1-le n2 check N1 is less than or equal to N2N1-ge n2 Check if N1 is greater than or equal to N2 n1-lt n2 check N1 is less than N2N1
Some of the more functional requirements are relatively simple to consider using the shell script to write, so as to facilitate fast and stable1. Read the file value, open and close some programs according to the file value 1 or.A. While:DoDoneis an
Format: Test conditionString test: Note space: Test STR1 = = STR2 Tests if string is equal test str1! = str2 test string is not equal test STR1 tests if string is not empty test-n str1 test string is not empty test-z str1 Test whether the string is
1.crash Log run-to-collapse positioningDwarfdump--arch=--lookup 0x44b79 .app.dsymAtos-arch o .app/ 0x000235f32.xcode installation path Query and settingsXcode-select-print-path #查询Xcode-select--switch #设置3. View the instruction set of the
. Cat commands"Cat" stands for Nexus (concatenation), connects two or more text files, or prints the contents of a file in standard output form.. CP command"Copy" is the copy. It copies one file from one place to another.MV CommandThe "MV" command
There are three types of conditions that are commonly tested in bashConditional test expression: [expression] [[expression]]First: Integer test:-eq tests whether two integers are equal, such as [$A-eq $B]-ne test two integers in different sizes-GT
$#, the number of arguments followed by the script runtime#! /bin/bashCase ' $# ' in 0) printf "Enter A number: " Read n= $REPLY ;; *) n=$1 ;;EsacX=$ (((1 + $n) * $n/2))echo "Tne value of 1 + 2 + 3....+ $n = $x"The
sudo uname--m View the number of operating system bitssudo uname--s display kernel name ssudo uname--r display kernel versionsudo uname--n display the network host namesudo uname--p display CPUUnder Ubuntu, text files are usually opened with the
$ represents the current process when using the Echo $$ is the PID that will output the current shell1 Echo $$
List of special variables
variables
meaning
$
File name of the current script
1. Declaration of variablesName= "Blacksonny" Note://variable definition does not add $, the variable and equal sign cannot have spaces betweenVariable naming rules:
The first character must be a letter (a-z,a-z).
You can use an
Code: Script_name parameter1 parameter2 Parameter3 ...It's easy to guess that the $ A is the shell script name (path) itself, and $ $ is the first argument, and so on .... you have to pay attention to the role of IFS, that is, if IFS is quoting,
Manually enter a line of strings and sort them.The script is as follows:#!/bin/bash#a test about sortEcho "Please input a number list"Read -AArrs for((i=0;i${#arrs [@]}; i++)) { for((j=0;j${#arrs [@]}-1, j + +)) {if[[${arrs[j]} -GT ${arrs[j+1]}]];
Beijing time July 1 10:00, peanut Shell (hsk.oray.com) company issued a "Peanut Shell remote Management" platform. This platform is mainly used to manage the embedded peanut shell, such as the embedded management of the peanut shell in the Qnap Nas,
Shell-automatically deploy war packages to tomcat and shell-tomcat#! /Bin/shCURL = $1CRootDir =/data/tomcat-usercenterShRootDir =/data/tomcat/dll# Delete old versionRm-rf $ shRootDir/usercenter-web.war *# The default war package address is the last
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