[This is my own study notes, welcome reprint, but please specify the source:http://blog.csdn.net/jesson20121020]
Take a look at some of the variables in the shell today.
Variable Type:There are several variables in the shell:1) Local
one, parentheses, bracket ()
1. Single bracket ()① Command Group. The commands in parentheses will be executed in a new sub shell sequence, so the variables in parentheses cannot be used by the rest of the script. Multiple commands in
The braces and parentheses in shell I want to talk about here are several types of shell parentheses, the structure of braces and the variables in parentheses. The command usage is as follows: www.2cto.com 1. $ {var} 2. $ (cmd) 3. () and {} 4. $
One, parenthesis, parentheses ()1, single parenthesis ()?? ① Command Group. The commands in parentheses will run in a new sub-shell sequence. So the variables in parentheses cannot be used by the rest of the script. Multiple commands in parentheses
Php displays the current time in real time
". $ N; echo" document. write ('?');". $ N; echo "var y = ". date ("Y "). "; // year ". $ n; echo "var m = ". date ("n "). "; // month ". $ n; echo "var d = ". date ("j "). "; // Day ". $ n; echo "var w =
One, parenthesis, round brackets () 1, single parenthesis ()
The command group . The commands in parentheses will be executed in a new sub-shell sequence, so the variables in parentheses cannot be used by the rest of the script. Multiple
The string interception of Linux is useful. There are eight different ways.
Suppose there are variable var=http://www.aaa.com/123.htm.
1. # Intercept, delete left character, keep right character.
Copy Code code as follows:
Echo
Intercept string:
Set var=10203040
The first digit is the position, the second position is the length, the second position if none, the default is the end, and the first position if it is a negative number, then the position in the opposite
Linux Shell string interception is useful, there are eight ways:
Assuming there are variable var=http://www.aaa.com/123.htm
1. # Intercept, delete left character, keep right character.
Echo ${var#*//}
where Var is the variable name, # is the
Linux shell string truncation and splicing, linuxshell
Linux string truncation is very useful. There are eight methods.
Assume there are variablesVar = http://www.linuxidc.com/123.htm
1 # intercept, delete the characters on the left, and retain the
In JavaJudge whether it is nullIs nullIf (s = null ){// Do something} Not nullIf (s! = Null ){// Do something} Determines whether null or empty stringIs null or empty string: method 1If (s = null | s. length () = 0 ){// Do something} Is null or
As mentioned above, variable names can only contain numbers, letters, and underscores, because some variables that contain other characters have special meanings. Such variables are called special variables.
For example, $ indicates the ID of the
String interception of Linux is useful. There are eight ways.Suppose there is a variable var=http://www.aaa.com/123.htm.1. # Intercept, delete the left character, leave the right character.The code looks like this: Echo ${var#*//}where Var is the
Bash string processing (against Java)-2. String Representation (String constant)
In JavaYou know!Use single quotes to indicate character constants: 'C'Double quotation marks are used to indicate a String constant: "hello world" Java character escape\
From: http://blog.sina.com.cn/s/blog_7c95e5850100zpch.htmlSuppose there is a variable var=http://www.linuxidc.com/test.htma # Intercept, delete the left character, and leave the right character. echo ${var#*//} where var is the variable name,#
One, what is deferred environment variable extension?
Delay variable Full name "Delay environment variable extension", to understand this thing, we have to understand what is called variable expansion!When we explain our command, CMD will first
1. Shell Introduction 1.1 Shell appearance backgroundThe Shell is both a scripting language and a software for connecting cores and users.For the graphical interface, the user can start a program by tapping an icon, and for the command line, the
1. #号截取, remove the left character and leave the right character. Code: Echo ${var#*//}where Var is the variable name, #是运算符, *//indicates that the first//and all characters on the left are deleted from the left. Example:650) this.width=650; "
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.