3 ms·
Well said. It's possible to write shell scripts that are portable between Mac and Linux, but it takes years to learn all the places where the semantics differ.
by adonovan 5y ago
Well said. It's possible to write shell scripts that are portable between Mac and Linux, but it takes years to learn all the places where the semantics differ. For example, there's no portable way to call sed with both -e and -i flags. In many cases it's better to say "this script assumes Linux" (and perhaps use Docker to simulate Linux) than to waste time supporting another platform.