How to include file in a bash shell script

Simply put inside your script :

source FILE

Or

. FILE # POSIX compliant

$ LANG=C help source
source: source filename [arguments]
Execute commands from a file in the current shell.

Read and execute commands from FILENAME in the current shell.  The
entries in $PATH are used to find the directory containing FILENAME.
If any ARGUMENTS are supplied, they become the positional parameters
when FILENAME is executed.

Exit Status:
Returns the status of the last command executed in FILENAME; fails if
FILENAME cannot be read.

Above answers are correct, but if you run script in another folder, there will be some problem.

For example, a.sh and b.sh are in same folder, a use . ./b.sh to include b.

When you run script out of the folder, for example, xx/xx/xx/a.sh, file b.sh will not found: ./b.sh: No such file or directory.

So I use

. $(dirname "$0")/b.sh