I believe this is because MacOS ships with BSD sed and this assumes GNU sed.
I fixed this by installing gnu-sed and setting up PATH so that sed resolves to GNU sed, but I guess it'd be nice to have this code handle BSD sed properly, perhaps by sticking to just the subset of the interface that is common across all of POSIX, or at least detect the problem and issue a nice error message.
When running on MacOS, the sed commands fail with:
I believe this is because MacOS ships with BSD sed and this assumes GNU sed.
I fixed this by installing gnu-sed and setting up PATH so that
sed
resolves to GNU sed, but I guess it'd be nice to have this code handle BSD sed properly, perhaps by sticking to just the subset of the interface that is common across all of POSIX, or at least detect the problem and issue a nice error message.Details on some of the differences: https://unix.stackexchange.com/questions/13711/differences-between-sed-on-mac-osx-and-other-standard-sed
Thanks a lot for this code!