Today, I continue to read the building LINUX embedded systems book. In chapter 4, there are some practical operations. After introducing the good organizational structure (folder, we recommend that you use a script in different development environments. The script contains an export and CD command, which is assumed to be
Export project =/home/AAA/project1
CD $ Project
And the name is test.
I executed $./test and found no effect. Then I added two trace statements in it, as shown below:
Export project =/home/AAA/project1
Echo $ Project
CD $ Project
PWD
Can be correctly executed, and PWD can point to the expected path. However, after the./test script is executed, the set environment is not retained, the original environment is restored, the current directory is restored, and the project content is cleared. If you need to keep the environment effective, you need. Test. We can execute. XX or./XX as needed,. XX can retain the execution environment or results in the shell, but./XX cannot.
Related Links: My articles on Linux operations