Hacker News new | past | comments | ask | show | jobs | submit login

Bash is installed on my own primary system(s). And generally a quite recent version. When I'm coding my own utility scripts (or more likely: writing one-liners which may get reused through shell history, possibly eventually being memorialised as scripts), I'll make heavy use of bashisms for the reasons I've noted elsewhere: powerful, convenient, often performant.

But if I'm inflicting those or other scripts on other systems I'm highly cognisant that not all systems have either a modern bash, or bash at all, and will either write POSIX-conformant scripts there, or remove bashisms from my own scripts.

That is, availing myself to benefits whilst recognising limits to my approach.

A key benefit of scripting in the shell language used most frequently is that one is highly familiar with it. Scripting-only languages tend to be less familiar. They're also less available (sed and awk being the principle exceptions, which are also mandated under POSIX, and for which GNU variants also have idiosyncrasies (I run into this on MacOS all the time, and tend to make use of GNU sed/awk there).

Perl, Ruby, Python, Lua, node.js, Tcl, etc., have more capabilities, but are also unavailable on a large number of systems. (Often old or small systems. to be sure, but numerous all the same.)




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: