[#1839] Update bash styleguide.


Problem description
===================

This updates the bash script styleguide.


Changes description
===================

Update script for better error handling.


How to try and test the changes
===============================

reviewers @alibotean @dumol 

Please check that everything is OK.

Feel free to add things that are not specified. @dumol this is a good time to discuss bash styleguide.

Thanks!