The difference between how two scripts are executed in Linux:. XX and./xx

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.