Ubuntu – the difference between “source” and “.”


What is the difference between executing a script (e.g. /some/script) with source /some/script and . /some/script in Bash?

Best Answer

source and . are synonymous in Bash.

For anyone who might like to verify that the commands are simply synonyms and nothing more, look at the source code, say for version 4.3, and examine the file builtins/source.def. You will read that both of the built-in commands, source and ., use the very same function: source_builtin.