Some shell default variables

Test script as follows, I mainly want to test $0,$1,$2, $n, [email protected],$* default is what?#!/bin/shEcho ' $1= ' $Echo ' $2= ' $Echo ' [email protected]= ' [email protected]Echo ' $*= ' $*Echo ' $0= 'Test:# sh var.sh 1 2$1=1$2=2[Email

How a shell script executes multiple commands under Linux

1. Separate each command;Note: The execution of each command will not affect the execution of other commands. In other words, each command executes,However, there is no guarantee that each command will execute successfully.2. Separate && between

Shell Script Collation

Create the user who wrote the file650) this.width=650; "src=" Https://s1.51cto.com/wyfs02/M01/98/E0/wKiom1lBR5_gYB4HAAAoKuZARYU671.png "title=" Screenshot from 2017-06-13 19-44-27.png "alt=" Wkiom1lbr5_gyb4haaaokuzaryu671.png "/>Second, ping 172.25.2

Shell Script Rollup 2 delete files that have been created for more than 32 days

Shell Script Rollup 2 delete files that have been created for more than 32 days#!/bin/bash#date:2017-04-11#version:clear_ballcloud_back_v1.0#contents: removing the  /www /web/ballcloud_bakck/* , if the file is created above 32 day#cd

Shell scripts use tips 5--characters to separate

#!/bin/bash#filename:ifs. SH Data="name,sex,rollon,location"oldifs=$IFSIFS= for inch $data; do Echo Item: $item Done #IFS= $oldIFSSet IFS to, number separator#!/bin/Bash#filename:fenge.SH Line="Root:x:0:0:root:/root:bin/bash"oldifs=$IFSIFS=":"

Shell Special Symbols

*: wildcard, matches any character, such as LS *.txt to see all files ending in. txt?: matches any one character#: annotation characters\: escape character for converting special symbols to normal characters, such as Touch \#.txt to create a file

Cloud--hbase Shell

The specific HBase shell commands are shown in table 1.1-1 below:Below we will use the example of "A Student score table" to detail the commonly used HBase commands and how they are used.Here grad for the table is a column, course for the table is a

Shell Common monitoring scripts

1. CPU Idle ScriptTop-b-n1 |grep ' Cpu ' |awk ' {print $} ' |sed ' s/%//' |sed ' s/id,//'Assigning values to variablesCpu_id= ' top-b-n1 |grep ' Cpu ' |awk ' {print $} ' |sed ' s/%//' |sed ' s/id,//'Echo $cpu _idIf you only intercept integers, the

Shell script use tips 3--debugging

1. Use-X to open the Shell script tracking debugging functionEx:bash-x script.shOrSh-x script.sh2. Partial debugging of scripts using Set-x and set +x (input middle content)#!/bin/bash#filename:debug. SH for inch {1.. 6 }; Do -x echo $i

Shell Cut Command

Meaning: Split the file by column according to the delimiterSyntax format: cut [options] ... [File] ...-C, --characters by character-F,--fields by column-D,--delimiter specifies delimiter, default is tab (\ t)Example: viewing file contents Cat

Shell grep Command Daquan

grep: For fuzzy lookups, in standard input or file  Format: grep [option parameter] ... PATTERN | FILE ...Option parameter Description:- E,--extended-regexp PATTERN is an extensible regular expression-E,--regexp=pattern using PATTERN for matching

Run your own shell script

Shell scripts can be directly./**.sh, or bash **.shI use the./**.sh to run a script of my own, and the following error will appear:[Email protected]:~$./pixel. SH bash:. /pixel. SH : Insufficient permissions [email protected]: sudo ./pixel. SH

Executing shell scripts in Linux

This article mainly introduces the 4 methods of executing shell scripts in Linux, that is, 4 ways to run shell scripts in Linux, and the friends you need can refer to the followingThere are several ways to bash a shell script, and now make a summary.

Shell shortcut keys

Linux Command-line edit shortcut: History displays a list of command histories ↑ (Ctrl+p) Displays the previous command ↓ (Ctrl+N) Displays the next command!num executes the command history list of the num-bar command!! Execute the last command!?

Shell determines whether a folder or file exists

The folder does not exist and is createdif [!-d "/data/"];thenmkdir/dataelseecho "folder already exists" fiFile exists then deleteif [!-F "/data/filename"];thenecho "file does not exist" Elserm-rf/data/filenamefiDetermine if a folder existsIf [-d

Shell condition Test Statement if

Tag: Shell expression exists * * * Specify dir DIA statement return resultIf condition statement: The IF condition statement is divided into single branch structure, double branch structure, Multi-branch Structure-------------------------------------

Shell fourth (top)

Fourth articleUnderstanding shell command Execution Sequence analysisEach line that the Shell reads from a standard input or script is called a pipe (pipeline); it contains one or more commands, separated by one or more pipe characters (|).In fact,

Shell under Action:command not found

Today to test a colleague wrote a shell script, execution of the error when the code is "Action:command not found"650) this.width=650; "src=" Https://s4.51cto.com/wyfs02/M02/97/EE/wKioL1k1HGHTyUhuAAAe51KKRyw564.png "style=" float : none; "title="

Day eleven regular expressions and Shell Basics learning

Regular Expressions           A regular is a way to describe a character or string by combining symbols with special meanings, called regular expressions. Or, the regular is the rule used to describe a class of things. Life is full of regular: two

Shell Regular expression (1)

First, what is the regularA regular is a way to describe a character or string by combining symbols with special meanings, called regular expressions. Or, the regular is the rule used to describe a class of things.Second, grep1. Parameters-N: Show

Total Pages: 541 1 .... 448 449 450 451 452 .... 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.