Jamaal Francois asked 1 year ago
Title : Sourcing a file Vs executing a file in Linux?

Question :

Sourcing a file Vs executing a file in Linux?

1 Answers
Ruchin SinhaRuchin Sinha Staff answered 1 year ago

Sourcing a file is similar to executing the file, but sourcing makes the changes of the file applicable in the current shell itself. Usually when a script is executed, a new sub-shell is created and the script is executed in the sub-shell which makes the changes applicable in the sub-shell and not in the current shell.
A file can be sources by using any of the below commands.

source <file_name>
or,
. <file_name>

Thanks,
Ruchin

Cubastion is among a very small number of specialized Siebel CRM Oracle Gold Partners in SME.