source command not found in sh shell

/bin/sh is usually some other shell trying to mimic The Shell. Many distributions use /bin/bash for sh, it supports source. On Ubuntu, though, /bin/dash is used which does not support source. Most shells use . instead of source. If you cannot edit the script, try to change the shell which runs it.


In Bourne shell(sh), use the . command to source a file

. filename

In certain OS's/environments (Mac OS, Travis-CI, Ubuntu, at least) this must be:

. ./filename

(Credit to Adrien Joly's comment below)