OS X is a popular developer platform, but sadly ships with BSD
versions of many popular utils. In this script, getopt is not needed
and is widely cited as bad form to use. sed proved to be a more
challenging fix, as the BSD sed requires a newline after a command.
This is easy to implement in an interactive shell, but proved to
cumbersome inside a script. Instead, I chose to detect the OS, probe
for the existence of gsed, and fail if it's not installed.
Lastly, the shell interpretter was malformed as a comment, and
modern scripts are usually written with the interpreter not hardcoded.
OS X is a popular developer platform, but sadly ships with BSD versions of many popular utils. In this script, getopt is not needed and is widely cited as bad form to use.
sed
proved to be a more challenging fix, as the BSD sed requires a newline after a command. This is easy to implement in an interactive shell, but proved to cumbersome inside a script. Instead, I chose to detect the OS, probe for the existence of gsed, and fail if it's not installed.Lastly, the shell interpretter was malformed as a comment, and modern scripts are usually written with the interpreter not hardcoded.
Fixes #52
This change is