Temporary variable
open a new sh, temporary variable does not exist
In the shell script is running, the system will first look for the environment variable ENV
the environmental variable specifies the file (load order is usually / etc / profile ~ / .bash_profile ~ / .bashrc / etc / bashrc)
Implement local variables to take effect
Edit user variables file
effective immediately command
to open a new sh, variables exist
Ordinary users to switch variable does not exist
under realization / mnt script performed directly
edit user variables file
to display the PATH environment variable
to achieve global variables to take effect
editing system variable file
Effective immediately command
to switch the average user, variables exist
.
Double quotes: After the resultant non seen, it will first multivariate analysis, then the output
double quotes * to display the
following symbols unresolvable
Single quote: WYSIWYG
backslash (\): the escape character / escape character, Linux if you want an escape character echo play a role, we must use the -e option, and the escape character to use double quotes
backticks ( ``): replace command, the command commonly used for outputting the result to a variable
in another way
.
$ Symbol usage
editing the file
$ 1 $ 2 $ 3 is a sequence of transmission parameters, all $ * $ @ $ # is the number of parameters is the file name is $ 0
Edit the file
transfer parameters 2. 3. 1 br />! [] (Https://s1.51cto.com/images/blog/201909/03/8c91ff9728fa49f7de85cd9ee6df8c33.png?x-oss-process=image/watermark,size_16,text_QDUxQ1RP5Y2a5a6i, color_FFFFFF, t_100, g_se, x_10, y_10, shadow_90, type_ZmFuZ3poZW5naGVpdGk =)
$ @ to each parameter as a string return
pass parameters 123
$! process PID background process of Shell last run of the last process (running in the background ID number)
$? end code of the last command run (return value) that is executing a command return value (final command to display the exit status of 0 means no error, any other value indicates an error)
$$ PID Shell itself (ProcessID, that is, the script runs the current process ID number)