Shell Environment variables
Shell is also an application, working with user mode
Variable type
Plastic
Floating point Type
Character type
Boolean type
Bash Variable type
Local variable: Valid only for the current shell
Local variables: Valid only for local code snippets (functions)
Environment variable: Expor var_name=value, valid for current shell and child shell
Position variable: $1;$2 ....
Special variables: $?; $!; $$ ....
View environment variables
Printenv
Export
View all variables
Set
Bash's Quotes
Double quotation mark: Weak reference, can realize variable substitution;
Single quotes: Strong references, not replacements, and display of the string itself;
Anti-Quote =$ (): Command Reference
Liezi:
[Email protected] ~]#name=tom
[Email protected] ~]# echo "I is $name"
[Email protected] ~]# I is Tom
[Email protected] ~]# echo ' I is $name '
[Email protected] ~]# I is $name
[Email protected] ~]# date=$ (date +%f-%t)
[Email protected] ~]#Echo $date
[Email protected] ~]# 2014-07-07-17:27:33
Bash features
Variable
Shortcut keys
Command aliases
Command line expansion
Pipeline
Input and output redirection
Programming
Command line completion
Path completion
This article is from the "Hanging Sword" blog, please be sure to keep this source http://sublime.blog.51cto.com/8856101/1439609