4 ms·
Not sure I follow. OS X comes with the Bash shell and I have plenty of shell scripts (bash and perl) for automating my dev environment and numerous other tasks
by Moto7451 14y ago
Not sure I follow. OS X comes with the Bash shell and I have plenty of shell scripts (bash and perl) for automating my dev environment and numerous other tasks that run fine on both Ubuntu and OS X. OS X using FreeBSD as its Unix layer doesn't preclude it from interoperability with other *nix like systems.
- pbiggar 14y agoThere are differences between BSD and GNU utilities that manifest a lot. ps uses different syntax. find has a different output style. grep doesn't support -P.
- FooBarWidget 14y agoIf you've ever seriously written shell scripts you'll know that they're not 100% portable. You always have to go through hoops to make them work properly across operating systems systems. BSD and OS X come with the BSD userland tools, with the exception of bash being default on OS X. Linux comes with the GNU userland. A few differences from the top of my head: - BSD utilities do not accept any -options after filenames, GNU utilities do. - The situation is reversed for BSD find. It insists on accepting a directory name as the first parameter. - BSD sed doesn't support the -i option in the same way as GNU sed does. - Even different versions of GNU utilities are not necessarily compatible. A few years ago I ran into compatibility problems with 'head', 'tail' and even 'free' across different Linux distros. I can't remember the exact issues though. So I agree with the grandparent, Node and Python are a lot more portable than shell scripts.
- Moto7451 14y agoAh I misunderstood the comment to mean the facility just wasn't available (being lumped in with Windows) which struck me as odd. I generally just wrap things in checks for $OSTYPE and Perl when I'm not working with the system itself.
- endgame 14y agoIf you want to write shell scripts that are portable to places without GNU or other reasonably featured tools, you'll have to be careful. http://www.gnu.org/software/autoconf//manual/autoconf-2.69/html_node/Portable-Shell.html http://www.gnu.org/software/autoconf//manual/autoconf-2.69/h...