3 ms·
Another issue in the "is Node right for this" is that it's very very portable, significantly more so that shell scripts (Mac uses BSD utilities, windows has not
by pbiggar 14y ago
Another issue in the "is Node right for this" is that it's very very portable, significantly more so that shell scripts (Mac uses BSD utilities, windows has nothing unless you have cygwin), and even slightly more portable than python.
- Moto7451 14y agoNot 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...
- pdonis 14y agoslightly more portable than python Can you elaborate on this?
- pbiggar 14y agoI don't have any great experience with Node, but my understanding is that its built around libuv, which is really good at abstracting this stuff. From my experience of writing python scripts, it looks like you'll occasionally see things like "this doesnt work on Windows". Only occasionally though, hence "slightly".
- pdonis 14y agoAh, ok, I wasn't aware of the libuv effort. Interesting.
- jussij 14y ago> windows has nothing unless you have cygwin A lot of the Unix tools (including SED) run just fine on Windows without cygwin: http://www.zeusedit.com/zforum/viewtopic.php?p=2683 http://www.zeusedit.com/zforum/viewtopic.php?p=2683