What does the line “#!/bin/sh” mean in a UNIX shell script?

It’s called a shebang, and tells the parent shell which interpreter should be used to execute the script. #!/bin/sh <——— bourne shell compatible script #!/usr/bin/perl <– perl script #!/usr/bin/php <— php script #!/bin/false <—— do-nothing script, because false returns immediately anyways. Most scripting languages tend to interpret a line starting with # as comment and … Read more

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.