path variables under linux

Disclaimer: This article is a blogger original article, shall not be reproduced without the bloggers allowed. https://blog.csdn.net/wangfenghui132/article/details/78480051

## below in linux often use this path variables, such as you compile some commands in the terminal, it often prompts some of the .o file is not found, one possibility is the path .o file is located not joined path inside. There is probably no ldconfig, reference documentation on this case papers reprinted.
When you open the terminal when the path to this variable, it definitely is (controversial from the local file .bashrc or .bash_profile file to initialize this point he is not sure which initialization files from later find out the changes do ). So in the end (thread), if you want to change the path variables can be changed directly, but after the change of variables just change the current path terminal (thread) to make. You exit the terminal is opened again when another terminal, path or the original path initialization time has not changed. So if a program often need to add some paths are changing the value of each path after entering the terminal is very troublesome, it is better to change the file directly.
There are often found after the completion of changing the path, often use this export PATH command after using the export PATH, close the terminal, open a terminal again, then change the path variable or not, that export PATH what the function is, why this operation can not fundamentally change the value of the path of this operation but also that export routines back inside again after PATH, this variable can be used to, which is the current thread all of the following sub-thread can use this variable . As an example, you open a terminal and type a username = wangfenghui, when you start a child thread in the main thread when the username is not worth it in the child thread which, for example, you enter bash, then the new opened a child thread, then enter the username, this variable is empty. When you exit the sub-thread bash with this exit, the use of export username, start a new child thread bash again, this output variable username, it will output wangfenghui.
##
In the following command line test terminal, (what is their brackets added)
name = WFH
echo namebashecho name
(this time will output a blank)
Exit
Export name
bash
echo $ name
(output) WFH
Exit

Guess you like

Origin blog.csdn.net/wangfenghui132/article/details/78480051