If I do:
#!/usr/bin/env bash
. "$HOME/.foo/bar.sh"
will it invoke/load that bar.sh script with sh?
is it any different than:
#!/usr/bin/env bash
source "$HOME/.foo/bar.sh"
If I do:
#!/usr/bin/env bash
. "$HOME/.foo/bar.sh"
will it invoke/load that bar.sh script with sh?
is it any different than:
#!/usr/bin/env bash
source "$HOME/.foo/bar.sh"
If you source another script in a bash script, then it's bash that sources that other script. The two command that you list are equivalent in bash.
source built-in (but not .) is a Bash extension, possibly inspired by the command of the same name in csh. It is not in the specifications for the POSIX shell.
source is a bash extension and that . is not, so he wonders if . would invoke sh (which it doesn't).