I'm coming from Linux to macOS, and many of my scripts assume GNU versions of the utils provided in GNU coreutils.
I could just put the GNU coreutils bin
directory in earlier in $PATH
than /bin
.
Is this commonly done? If I do it, what downsides/breakages should I expect in future?
[ $USE_COREUTILS -eq 0 ] && PATH=$PATH:/path/to/coreutils/directory
. This is how it would look in.bashrc
anyway. I doubt mac shells are much different. As far as I know, it would work with.zshrc
as well. I haven't tested the code, so you may need to iron out the kinks. Edit: or just use the Homebrew version mentioned below... : )