One, variable
A variable is a container in which different values can be placed.
Key facts:
Path,home,pwd,logname these are variables.
Example:
[[email protected] ~]# echo +ba+~]# echo $a +$b3+4~~ ]# echo $a 3$b4~]# echo $a"3"$b334
The summation of variables:
[[email protected] ~]# echo +ba+~]# echo $a +$b3+4~~ ]# echo $a 3$b4~]# echo $a"3"$b334
Delete a variable:
[Email protected] ~]# echo $a 3 ~~]# echo $a
A variable defined under one terminal cannot be used under another terminal, and if it is to be used, it must be defined in the configuration file of the environment variable. If you want the variable to work in a child shell, you can export it:
[[email protected] ~]# a=3~]# echo $a3~~~]# a=4 ~]# echo $a 4 ~ ~]# echo $a 4
II. environment variable configuration file
Points:
If we vim ~/.bash_profile, we will find:
#. bash_profile# Get the aliases and functions if [-F ~/. BASHRC]; Then ~/. bashrcfi# User specific environment and startup Programspath= $PATH: $HOME/binexport PATH
The original. bash_profile file will contain. bashrc.
PS1:
Experiment:
[Email protected] yum.repos.d]# ps1='\[email protected]\h \w'/etc/yum.repos.d
Linux Learning (22) Shell Foundation (ii) Variable, environment variable profile