This is pretty strange.
So I developed this thing called SahibLib
and it's basically a script that you source that sources a bunch of other scripts.
Its directory tree looks like this:
/home
|- /home/myuser
|- /home/myuser/sahiblib
|- sahibload <- executed in ~/.bashrc
|- sahiblib <- executed by sahibload
|- modules
|- core.sls <- problem file
|- example.sls <- problem file
What SahibLib is supposed to do is source the .sls
files. It doesn't do that though.
It outputs the correct message ("[SUCCESS] Thank you and goodbye."), but the actual files aren't sourced.
myuser@mypc:~$ slhelp
Invalid command.
Strangely, when I source the file manually, it works:
myuser@mypc:~$ . ~/.bashrc
[SUCCESS] Thank you and goodbye.
myuser@mypc:~$ slhelp
SahibLib Core Help
...
My question is, why isn't the script properly executing in ~/.bashrc?
Update: Writing some debug commands to core.sls
, it seems that the file executes perfectly. It gets to the end of the file, and returns a standard exit code. This makes the problem even more strange, because now it seems that Bash is just ignoring the function definitions outright.
Also, if you need to see core.sls
, or any of the files, they're available here