Difference between. XX and./XX in Ubuntu script Command Execution

Source: Internet
Author: User

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

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.