I have a small program which contains the following folder structure:
- main.sh
- lib/
- clean.sh
- get.sh
- index.sh
- test.sh
Each file contains a single function which I use in main.sh.
main.sh:
source lib/*
get_products
clean_products
make_index
test_index
In the above the first two functions work but the second two don't.
Yet if I replace source lib/* with:
source lib/get.sh
source lib/clean.sh
source lib/index.sh
source lib/test.sh
Everything works as expected.
Anyone know why source lib/* doesn't work as expected?
/etc/bashrcfor how it uses aforloop to deal with/etc/profile.d/*.sh. If you trust the contents oflib/it can be reduced to a one-liner:for i in lib/*.sh; do . "$i"; done– Rich Oct 04 '17 at 16:05