I have 3 files (loader.sh
, core/info.sh
and main.sh
). Here's the contents of the files:
main.sh
#!/usr/bin/env bash
bash loader.sh
info "Test"
loader.sh
#!/usr/bin/env bash
for i in core/*.sh ; do
source $i
done
core/info.sh
#!/usr/bin/env bash
RESET="\x1B[0m"
GREEN="\x1B[01;32m"
function info() {
printf "(${GREEN}Info${RESET}): $1\n"
}
Logically, it should "load" my files but I get this error:
main.sh: line 5: info command not found
Which means there's a problem either in my loader.sh
or core/info.sh