Today continue to look at building Linux Embedded Systems, into the fourth chapter, there are some practical operations, which after introducing a good organizational structure (folder), it is recommended that a script can be different development environment. It's simple, including an export and CD command, which is assumed to be
Export Project=/home/aaa/project1
CD $PROJECT
and take the name test.
I executed $./test, found no effect, and then added two trace statements inside, as follows
Export Project=/home/aaa/project1
Echo $PROJECT
CD $PROJECT
Pwd
Can be executed correctly, and PWD can point to the desired path. But when the./test script finishes executing, the settings environment is not retained, the original environment is restored, the original current directory is restored, and project content is emptied.
So: If the need for the environment has been effective, need. Test We execute. xx or./xx,.xx can preserve the execution environment or results in the shell, as required, while./XX cannot
The difference between how two scripts are executed in Linux:. XX and./xx