Programming languages are generally divided into static languages and dynamic languages.
Static language: Compiled language strongly typed (variable) pre-compiled
Example: C C + + Java C #
Dynamic language: Interpreted language weak type (default variable type is not distinguished, and the default type is String type)
Example: PHP Shell python perl
Object-oriented : Java python
process oriented : Shell
variables : Memory space, named memory space #能回收
memory : addressable memory space
the types of variables can be divided into: character, value, true and false declaration variable type is the role of predetermined storage format and length
logical Operations : with, or, non-, XOR, or
#非门在现实中使用电磁感应, switch closed circuit.
the variables in bash can be divided into: environment variables , local variables (local variables), positional variables, special variables
Local Variables ; Varname=value acting on the entire bash process
reference variable $ (VARNAME) variable can sometimes be omitted
Locals local Varname=value acting on the current code snippet
Environment Variables acting on the current shell process and its child processes
Export Varname=value "Exporting"
The child shell process is started as the script executes
The command-line startup script inherits the environment variables of the current shell
Scripts that are automatically executed by the system (not command-line startup) require a self-defined environment variable
position Variable $1,$2
Special variable $? Save Last Command execution status return value
Program status return code 0: Execute correctly
1-255: Error 1.2.127 System reservation
Output REDIRECT :>,>>,2>,2>>,&>
Example: ID username &>/dev/null #/dev/null for data black hole bit bucket
Undo Variable unset VARNAME #创建变量为
View variable Set
View the current shell environment variables printenv ENV Export
environment variable Add : String variable can be used, such as export path= $PATH:(add pathname)
This article is from the "11994222" blog, please be sure to keep this source http://12004222.blog.51cto.com/11994222/1854882
Shell Programming-Initial