DEV Community

Discussion on: 101 Bash Commands and Tips for Beginners to Experts

Collapse
 
jikuja profile image
Janne Kujanpää

More about source

In some systems source and . are interchangeable command. (POSIX compatibility is swamp)

Anyway source command is good if you need (temporary) setup your environment: e.g. load environment variables, aliases and even request passwords from user with read -s <variable_name> or to load functions from external libraries.

Usually source is used in scripts(1) but I'm sure that users can find use cases when to use source to setup environment for running shell.