3
1
I've been mostly pleased with MacOS as a dev platform, and it's somewhat similar to a linux command-line, but there are a number of notable exceptions:
all commands: arguments parsing behavior differs. Linux will accept flags in any order, including flags following files. In MacOS, flags following files are ignored; flags must be presented before any filenames
base64: not installed by default. once installed, does NOT accept the '-i' flag which is required on Linux to ignore whitespace in base64 encoded text.
sed: MacOS treats the "-i" flag VERY differently than Linux (requires an extension which breaks scripts on Linux). extended regex is "-E" on MacOS and "-e" on Linux
(plus a variety of other issues...)
In almost every case, I have found the Linux behavioral variant to be easier to use / more powerful. Is there a way to upgrade the MacOS command-line utilities to make it more similar to Linux? Or am I thinking about this wrong and should drink some kool-aide? It's minor, but these glitches have me pulling my hair out when trying to move back and forth between Linux / MacOS dev boxes.
1You should refer to the OS as "Mac OS X" or just "OS X", and not "MacOS", which is the name that was used 10 years ago, before OS X, and before there was a UNIX foundation to the operating system. OS X is essentially built on NeXT. They built an emulation layer for the old MacOS (called "Classic") but basically no one uses that anymore: it was just for handling the transition from MacOS (Classic) to Mac OS X. Googling will give you a more complete history, if you're interested. – iconoclast – 2011-07-14T19:10:13.937
@Brandon Mac OS X has been the only Mac OS for a decade now, and given the additional context of porting Unix shell scripts, there was absolutely no ambiguity in what he said. Did you really think he might have been referring to MPW? – Spiff – 2011-07-14T19:19:23.297