Great guide here to defensive programming with bash.
http://www.kfirlavi.com/blog/2012/11/14/defensive-bash-programming/
Basically put everything in functions, use a main() at the top and a
main "$@"
at the bottom.
Great guide here to defensive programming with bash.
http://www.kfirlavi.com/blog/2012/11/14/defensive-bash-programming/
Basically put everything in functions, use a main() at the top and a
main "$@"
at the bottom.