2 ms·
Wouldn't a more robust check be the following: if [[ "${BASH_SOURCE[0]}" = "${0}" ]]; then hello "${@}" exit $? fi
by ndsipa_pomu 5y ago
Wouldn't a more robust check be the following:
if [[ "${BASH_SOURCE[0]}" = "${0}" ]]; then
hello "${@}"
exit $?
fi
- joombaga 5y agoI would add the index on BASH_SOURCE, but the braces on $0 and $@ are just verbose.
- ndsipa_pomu 5y agoAgreed - I just put braces and quotes wherever I can. There's also no need for the quotes inside double brackets, but I prefer a consistent (verbose) style.