Using dot or "source" while calling another script - what is the difference? Using dot or "source" while calling another script - what is the difference? bash bash

Using dot or "source" while calling another script - what is the difference?


The only difference is in portability.

. is the POSIX-standard command for executing commands from a file; source is a more-readable synonym provided by Bash and some other shells. Bash itself, however, makes no distinction between the two.


There is no difference.

From the manual:

source

source filenameA synonym for . (see Bourne Shell Builtins).