Someone demonstrated a zsh, and looked very cool. The shell must be unique, so it's a piece of it.Zsh, like Bash, is also a shell, except that it has its own differences, either gifted or inferior. When I started writing this record, I just
Original address: http://www.cnblogs.com/chengmo/archive/2010/10/02/1841355.htmlString-related operations are often involved in the shell batch process. There are a lot of command statements, such as: awk,sed can do string various operations. In
If statement 1) if ... else statementSyntax for the IF ... else statement:if [Expression]then if is true fiIf expression returns True,then, the statement is executed and no statement is executed if False is returned.Finally must end with FI to
View types of commands: type[[Email protected] ~]# type CDCD is a shell builtin[[email protected] ~]# type Lsls are aliased to ' ls--color=auto ' [[Email Protected] ~]# type-a Lsls is aliased to ' ls--color=auto ' ls is/bin/ls[[email protected]
Transferred from: Http://blog.163.com/[email protected]/blog/static/132229655201131055455754/Numeric operations:Only integer arithmetic is provided in bash, and the shell is implemented by the two commands of Let and expr .Use the format: let "x=
How to determine the number of input parameters in a shell script submission: Junjie font: [Increase decrease] type: Reprint
This article mainly introduces the method of judging the number of input parameters in shell script, using the built-in
is a weakly typed variable that does not need to specify its variable type when declaring it, and does not need to follow the "declare before use" and can be used whenever you want. A variable in which a local variable is in effect in a shell is not
What is a function?A function is a collection of commands, represented by a name, called a function name. The function name has the same naming convention as the variable.Once the function is defined, execute the name as if it were a bash command
1, the implementation of the Sourse directory part of the file (the file name is listed as a text list, text file name list), copied to another directory/opt/targe/#!/bin/bashcd/opt/source for file in ' cat/opt/source/list ';d ocp-r-n
Advanced variable contains three parts1. Variable expansion2. Command replacement3. Arithmetic ExpansionIn the bash shell, the $ operator triggers the above three extensions in the following basic form:Basic types of extensions examples${variable
If condition judgment
Comparison of Numbers-eq equals if [$a-eq 11]; Then commend Fi-GT Greater than
-lt less than-ge greater than or equal to-lt less than or equal tostring comparison = = string comparison must have a space if [$a = ' yes ']
The return value of the Shell function (return), which only supports integers#!/bin/shget_str () {return "string"}get_strecho $?The output is as follows:./test.sh:line 5:return:string:numeric Argument required255You can see that the return integer
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, hehe1. Examples of error methodsAVar=1+1Echo $varThe result of the output
There's a post on stack overflow, "What's your most controversial programming opinion?" translated into Chinese is " What do you think is the most controversial programming idea?" However, in more than 400 main huitie, as well as thousands of huitie,
Company personnel named image used to add a space, today there is a need, to bulk download this write pictures, this egg hurtThe correct URL is thisHttp://url 2119 01.jpgHttp://url 001.jpgWritten into the text will be added to escape,
The shell program mounts the iso image file and configures the local yum source,
write a script, mainly do 1. Mount the local iso image file 2. boot the local iso image and mount it automatically 3. Use the iso image to configure the local yum
The shell script is used to add a user to delete a user's deleted files,
#/Bin/bash # DEBUG = 0ADD = 0DEL = 0RM = 0 while [$ #-gt 0] docase $1 in-v |-verbose) DEBUG = 1 shift ;; -h | -- help) # help document echo "'basename $ 0' -- add LIST -- del
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