./(dot slash) with. (dot space) The difference between executing a script file

Source: Internet
Author: User

First, popularize a knowledge point:. (dot space) Mo script file is equivalent to using the source file to execute this script.


SOURCE Command usage:

SOURCE FileName
Function: Reads and executes the commands in the filename under the current bash environment.
Note: This command usually uses the command "." To replace.
such as: source. BASH_RC and. The. BASH_RC is equivalent.
Note: The difference between the source command and the shell scripts is that
Source executes the command in the current bash environment, and scripts starts a child shell to execute the command. This way, if the command to set the environment variable (or alias, etc.) is written into scripts, it will only affect the child shell and cannot change the current bash, so use the source command when setting the environment variable through the file (command column).

Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.

./(dot slash) with. (dot space) The difference between executing a script file

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.