shell will stop execution when an error happens.
sometimes you need to use -e to find errors. but in the whole shell, still few parts need to be allowed with error.
1. encapsulate it in a standalone script and and use bash to run it.
2. when use source or . to include a shell, the #! at the beginning of the sub-shell will be ignored.
3. use set +e/set -x before and after the shell function.