sh-# Export
Export console= "/dev/console"
Export Home= "/"
Export Ld_library_path= "..."
Export OLDPWD
Export path= "/bin:/usr/bin:/sbin:/usrbin"
Export prevlevel= "N"
Export pwd= "/"
Export runlevel= "4"
Export shlvl= "3"
Export term= "VT100"
Export terminfo= "/usr/share/terminfo"
sh-#
The Export command is the shell builtin command.
sh-# Type Export
Export is a shell builtin
Environment variables set using the Export command will only take effect in the current system and must be set in the/etc/profile, ~/.bash_profile, or ~/.BASHRC configuration files if you want to make them permanent
1. How can I view the value of a specified environment variable?
sh-# Echo $PATH
/bin:/usr/bin:/sbin:/usrbin
2. What if I modify the value of an environment variable?
sh-# export path= $PATH:./
sh-# Echo $PATH
/bin:/usr/bin:/sbin:/usrbin:./
3. Use the Export command to define a new environment variable directly, and the value of the environment variable can be inherited into the child process.
sh-# export New_var=xulin
sh-# echo $NEW _var
Xulin
sh-#
sh-# export
Export console= "/dev/console"
Export home= "/"
Export new_var= "Xulin"
Export oldpwd= "://basic/"
Export path= "/bin:/usr/bin:/sbin:/ usrbin:./"
Export prevlevel=" N "
Export pwd="/"
Export runlevel=" 4 "
Export shlvl=" 3 "
Export term=" VT100 "
Export terminfo="/usr/share/terminfo "
sh-#
4. How do I delete an environment variable?
Use the-n option to temporarily invalidate a specified environment variable in the currently running system, unless you restart the system to recover.
sh-# Export-n New_var
sh-# Echo $NEW _var
Xulin
sh-#
sh-# Export New_var=xulin
sh-# Echo $NEW _var
Xulin
sh-#
sh-# Export
Export console= "/dev/console"
Export Home= "/"
Export oldpwd= "://basic/"
Export path= "/bin:/usr/bin:/sbin:/usrbin:./"
Export prevlevel= "N"
Export pwd= "/"
Export runlevel= "4"
Export shlvl= "3"
Export term= "VT100"
Export terminfo= "/usr/share/terminfo"
sh-#
This is true through the following validation.
sh-# Export | grep New_var
sh-#
sh-# Set | grep New_var
New_var=xulin
sh-#
The Export command is used to set environment variables.