Wave + TV base

bash variables defined by default:

The default type is a string variable, declare may specify other types of

$ Sum = 100 + 300 + 50 # If the specified type, the 100 + 50 300 + default string

$ echo $sum 

100+300+50   

$ Declare -i sum = 100 + 300 + 50 # specified sum variable shaping

$ echo $sum

450 

$ Declare -x sum # sum specified variable as an environment variable

Environment variables: the equivalent of a global variable, which is stored in the system memory space is a shell prepared, the other subprograms can be drawn, such as other terminals.

If you use export command in the parent process that allows variables to customize the writing above memory space, become an environment variable.

System variables: some relevant information when the script runs, and agreed in advance.

Position variable : input parameters while running the script, the variable parameters corresponding to the position variable called, for example:

ping.sh 1.1.1.1   2.2.2.2

$ 0: Script name ping.sh

$ 1: The first parameter, 1.1.1.1

Guess you like

Origin blog.csdn.net/xiong3110/article/details/95042801