source and export diff
Non-interactive shells don’t load initialization files, so bash -c 'declare -f' doesn’t output anything. But we can source it: bash -c 'source ~/.bashrc; hello'. Or even: bash -c 'hello() { echo "hi"; }; declare -f'.
It’s all about memory share in shell modes:
sourcechanges only affect current shell memory.exportmarks variables to be passed to child processes.
Subtile difference that can save us lots of debugging time.