I have heard it said, multiple times, that in Bash source
is merely an alias for .
. Even in the Bash man page. However, I've noticed, while digging into this question that they are not identical when called via find
. Here is a reproducible example:
I've created a file called test.sh
uberhumus@pc:~/tmp$ cat ./test.sh
#!/bin/bash
echo "Kazabooboo"
uberhumus@pc:~/tmp$ find ~/tmp -type f -iname "test.sh" -exec . {} \;
find: ‘.’: Permission denied
uberhumus@pc:~/tmp$ ind ~/tmp -type f -iname "test.sh" -exec source {} \;
find: ‘source’: No such file or directory
My question is what causes the difference, and are there any other differences that aren't discussed?