Special usage of $0,$?,$! in shell

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

Shell Script Pass Parameter

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

Linux Shell Command Series (5) VI Editor

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

Shell Learning Summary

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

Shell Script debugging

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

Linux Shell Digital Computing

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

Shell script usage Record

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

sed command in Shell

Sed-i '/CD ${ldir_dest}\/webextend\/pc && ln-s \/hard\/www_winclient\/bboxpc.exe./a\ \TCD ${LDIR_DEST}\/ WEBEXTEND\/PC && ln-s \/hard\/www_winclient\/' $i '. '#参考别人后自己改的, it's mostly a variable.Sed-i ' 4i dfsdfdsad ' xxx.txt #Insert contents between

Variable test of Shell entry

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

Shell Common Commands

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

Linux Shell Command Series (4)

. 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

Linux shell Programming (ii) Condition testing

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

Introduction to shell-related directives

$#, 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

Linux Shell Simple Commands

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

Special variables in the shell

$ 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

Use of variables in the shell

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

In the shell, we can use $ A, $, $, $ ... This variable extracts the variables in the command line

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,

Shell script Implementation Bubble sort

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]}]];

Peanut Shell release Remote management platform intelligent device for real-time monitoring

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

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

Total Pages: 541 1 .... 437 438 439 440 441 .... 541 Go to: GO

Contact Us

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

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.