What does source in Linux console commands mean?

From time to time you will come across this syntax

Using the source command when running a script guarantees the script is run with the current environment variables in the current shell. Instead of using source you could also use a “.” like this:

This method to run a script should not be confused with more common way to run scripts or programs with a leading “./”.

The use of “./” will use a new shell for the the script. Therefore the script will not be able to use current environment variables.

1 One person thinks it's helpful 🙂

Leave a Reply

Your email address will not be published. Required fields are marked *