Including Other Files in Scripts

If you need to include another file in your shell script, use the . operator. For example, this runs the commands in the file config.sh:

. config.sh

This "include" file syntax does not start a subshell, and it can be useful for a group of scripts that need to use a single configuration file.

Get How Linux Works now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.