Bugfix: minor edits for bash compatibility

Without this change, the chgo.sh script fails under bash 3 and bash 4.
Tested with both versions (stock MacOSX 10.10 version (3.2.53) and a newer
version (4.3.30) installed via homebrew) under MacOSX 10.10 (Yosemite).