3 ms·
There are several commands on OS X that behave a bit differently from their traditional UNIX counterparts. grep is the big one that springs to mind—any given gr
by JasonSage 10y ago
There are several commands on OS X that behave a bit differently from their traditional UNIX counterparts. grep is the big one that springs to mind—any given grep shell-fu may just not work on OS X and I'll find myself having to reconstruct the arguments from scratch to get it working.
I'd love to see a fork of explainshell or an option in the interface to deal with items like this which are specific to OS X. Let me put a grep command in for OS X and have it show me what options I'm using which are undocumented—that would be nifty.
- umanwizard 10y agoBy "traditional UNIX" do you mean GNU specifically? What on macOS differs more from standards than does the typical Linux distro?
- jandy 10y agoNot OP, but one I came across yesterday was `date`. Linux: `date -d '10 mins ago'` Mac: `date -v -10M` There's loads of tiny differences like this. Often just old versions, and you can pull in the latest with `brew` or something.
- btschaegg 10y agoAnother one is GNU find assuming the current directory if omitted, while BSD find explicitely has to be told the directory to search in. It's nothing complicated, but breaks many scripts if you only test them on Linux (more or less the same problem like case-insensitive filesystems). I'll have to add, though, that one could argue that OSX is the one behaving like "traditional UNIX", since most of it's tools derive from BSD-Versions. GNU tools are the ones that deviate from this (which I still find more convenient in day to day use).
- umanwizard 10y agoSure, I know there are lots of differences between GNU and macOS; that's not what I'm asking about.
- stirner 10y agoThe BSD coreutils that macOS uses are much more "traditional UNIX" than the GNU coreutils.