Display variables and set the display format of variables: # echo $... # echo $ variable # echo $ PATH or echo $ {PATH} # myname = tian # echo $ myname can be enclosed in double quotation marks or single quotation marks if there is any space in the variable, however, special characters in double quotation marks, such as $, can maintain the original characteristics. The single quotation marks are generally characters. To provide information through other commands, you can use the unquoted command or $ (command), such as version = $ (uname-r). If the variable needs to be executed in other sub-processes, use the export declaration to program environment variables. Cancel the variable and use "unset variable name" to accumulate PATH = $ PATH:/home/dmtsai/bin =$ {PATH} using the escape character name = vbnird \'s \ space name }: /home/dmtsai/bin display environment variables # env view all variables # set $ display the shell PID (shell thread code) # echo $? Display the return code of the previous command 0: Success 1: Failure # echo $? Export: converting a custom variable to an environment variable only inherits the environment variable of the parent process, custom variables are not inherited # All environment variables of export are listed # The export variable name declares the custom variables as Environment Variables