The shell script, as its name implies, is a script written for the shell, as long as there is a text editor and an interpreter that can execute the script.There are many types of Shell in Linux, we can open a text editor (can use the Vi/vim command
20171123 Linux Shell Basics Learning Notes1. The beginning of the shellGenerally #!/bin/bash through the #! To uniquely specify the shell path to useThe other # all represents comments.2. Shell variablesDefine variables directly with variablename=
One, variableA variable is a container in which different values can be placed.Key facts:Path,home,pwd,logname these are variables.Example:[[email protected] ~]# echo +ba+~]# echo $a +$b3+4~~ ]# echo $a 3$b4~]# echo $a"3"$b334 The summation of
Classification of regular Expressions:1. Basic Regular Expressions (basic Regular expression also known as basic RegEx abbreviation Bres)2. Extended Regular Expressions (Extended Regular expression also known as Extended RegEx abbreviation Eres),
I. Three ways to take random numbers and encrypt them1.random of Fetch and encryptionThe method of taking the number:650) this.width=650; "src=" Https://s3.51cto.com/oss/201711/14/dba3bd986bd100e199cecf8a1067e559.png "title=" Screenshot from 2017-11-
Start, close HBase./bin/start-hbase.sh./bin/stop-hbase.shQuery the HBase version. Its syntax is as follows:HBase (main):010:0> versionBuild tableCreate ' ', ' 'Create ' emp ', ' personal data ', ' professional data 'List all tables: ListTable
One, Shell scriptScript: Can execute the file, after running can implement some function (command stack, non-interactive)Standardize the general composition of shell scripts#! Environmental Statement (Sha-bang)# comment TextExecutable codeSecond,
Recently learning shell programming, a little bit of gadgets to automate the collection of AWR reports, to facilitate problems in the system when troubleshooting.The contents of the script are as follows, the system collects the AWR report from 20 o'
1 Specifications for Shell scripts:1 file suffix is. sh2 first line is the command interpreter: #!/bin/bash3 The first line below the comment write script basic information:Script name, function, writing time, author, contact, etc.2 Shell Execution
Use the conditional function if to compose a shell function called F_judge, which implements the following functions1) when the/home/log directory exists, move the files or directories that start with all TMP in the/home directory to the/home/log
(title): Determine if the incoming parameter is IPIdea: 192.168.1.1is the condition of the IP, * * * dot decimal This four number must be less than 255Dot decimal must be guaranteed to be a number, not a letter#!/bin/bash[ -z $1 ] && echo "uesage :
1./dev/null/dev/zero ①/dev/null:/dev/null, called an empty device, is a special device file that discards everything written to it (but reports a successful write operation) and reads it immediately to get an EOF. In Unix jargon,/dev/null is called
Knowledge Points:
Array
function Local Variables
Defining pass-through parameters
Example 1:A= (1 2 3) b= (a B c) function () {Local a=$1 local b=$2 for I in $a does echo $i done Ech o $b}funcition "${a[*]}" "${b[*]}" Result: 12
Task required: When I need to compress the files in a folder separately:The original code:1 #!/usr/bin/shell2 function Getdir () {3 forElementinch' LS $`4 Do5 #Echo $element6Dir_or_file=$1$element7 8 #Echo $dir _or_file9
Reference URL: http://www.cnblogs.com/chengmo/archive/2010/09/30/1839632.htmlThe Linux shell is much more powerful in programming than Windows batch processing, and cannot be compared in terms of loops, operations, and data types. Here is a summary
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