replaces bash with sh
bash is not installed by default in other platforms. Also, reduces several subshells to one.
@eliotmiranda I vote to accept this.
The travis check failure is bogus (two fails, completely unrelated to this PR),
the change is goot.
@fniephaus if you quote your variables (as they already are) you don't need [[ ]], which is not portable, as @krono correctly points out.
Thanks, @santana. Since I have been involved in creating this script and @krono also approves your changes, I am going to merge this...