When a file is sourced (by typing either source filename or . filename at the command line), the lines of code in the file are executed as if they were printed at the command line. This is particularly useful with complex prompts, to allow them to be stored in files and called up by sourcing the file they are in.
In examples, you will find that I often include #!/bin/bash at the beginning of files including functions. This is not necessary if you are sourcing a file, just as it isn't necessary to chmod +x a file that is going to be sourced .http://www.psdtolive.com/