Writing a shell script inevitably encounters the steps that require interactive input instructions:Method One:# Cat Action.sh#!/bin/shRead-p "Enter Number:" No;Read-p "Enter Number:" Name;echo you have entered $no, $name;# sh action.shEnter
First, declaring variablesMyurl= "http://see.xidian.edu.cn/cpp/linux/"mynum=100Attention:There can be no spaces between the variable name and the equals sign, which may be different from any programming language you are familiar with.At the same
Grammar:awk ' {command} ' filename multiple commands are separated by semicolons .awk ' begin {Command1} {Command2} End{command3} ' Note: Begin, END needs to be capitalizedCommon Variable Description:FS: Specifies the delimiter, which is the default
The assignment and operation in the shell is the string processing by default, here are some special methods of mathematical operation in the shell, which can be seen later, hehe.1. Examples of error methodsAVar=1+1Echo $varThe result of the output
Find FilesFind./-type FFind a DirectoryFind./-type DFind a file or directory with the name testFind./-name TestLook for a file whose name matches the regular expression, and note the preceding '. * ' (found file with directory)Find./-regex.
This article describes the most common tools for using the shell to process text under Linux:Find, grep, Xargs, Sort, uniq, tr, cut, paste, WC, sed, awk;The examples and parameters provided are the most commonly used and most practical.I use the
What is a regular 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.There are regular things in life:For
First, what is the bean Shell
BeanShell is a scripting language that conforms fully to the Java syntax specification and has its own syntax and methods.
BeanShell is a loosely typed scripting language (this is similar to JS);
Precautions1) Opening add interpreter: #!/bin/bash2) syntax indentation, use four spaces, and more explanatory notes.3) Naming recommendation rules: variable name capital, local variable lowercase, function name lowercase, the name reflects the
1. Introduction\2. The Business Server remotely updates the script to browse the server files#!/bin/bashoperate=$1IP=$2Conf_file="/var/www/html/test/ip_list"File_chsum="/var/www/html/test/cksvalue"File_ser="10.60.10.62"cksum () {SSH
Some good habits of shell scripting
1. Naming rules
The script name ends with. SH, and names are as famous as possible. Here are a few of the script naming styles that are available for reference. Through the following fresh and
the parentheses are the orders. curly braces are variable valuesOne, parenthesis, parentheses ()1 , single parenthesis ()① Command Group. The commands in parentheses will be executed in a new sub-shell sequence, so the variables in parentheses
Execute the "nano function.sh" command to create a new shell script file with the name "function.sh".650) this.width=650; "class=" Exp-image-default "alt=" How to write Function "src=" in shell scripts http://f.hiphotos.baidu.com/exp/w=500/ Sign=7148
What is a shell script?Plain Text Document --the data stored in the document is stored in a character unit;a large number of command combinations to solve user problems according to user's needs;"Power of Execution"-the result of the multiple
Http://www.cnblogs.com/puresoul/p/4915350.htmlFirst, what is the bean Shell
BeanShell is a scripting language that conforms fully to the Java syntax specification and has its own syntax and methods.
BeanShell is a loosely typed
Definition: array= (1 2 3)Echo ${array[0]}Echo ${array[1]}Echo ${array[2]}echo ${array[*]} all elementsEcho ${array[@]} The length of the arrayArray AssignmentArray= (1 2 3) There are 3 elements in this arrayArray[3]=4 4 elements in this
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