Come to discuss on the forum! ■ FAST and FREE signup. ■ |
😀 Access to discussion forums 😀 |
Help for HOMEWORKS, support in COMPUTER SCIENCE, help for learning FRENCH and ENGLISH, discussion on your INTERESTS and HOBBIES... |
Difference between "execute" a script and "source" a script
To launch a script and run it line by line, you have to either source it or execute it: Different ways to run a script.
Here is a summary of the differences between sourcing and executing:
So if you want your script to change the environment of the current shell, you have to source. Otherwise, you have to execute.
- Sourcing : allows to launch a command in the process of the current shell.
- Executing : allows to launch a command in a new shell.
Here is a summary of the differences between sourcing and executing:
Executing | Sourcing |
---|---|
|
|
|
|
|
|
|
|
So if you want your script to change the environment of the current shell, you have to source. Otherwise, you have to execute.
Share this page on social media:
Questions, comments?
Quick comments
There is no comment yet.