migrate most shell functionality from utility2.js to utility2.sh
fixing codeship build