1. 1

    The module sh is a fantastic tool for these kind of scripts. https://github.com/amoffat/sh