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

I actually agree with you. If all you use the shell for is to launch programs, do basic job control and redirect I/O and do some basic pipelines, then you should be fine.

But keep in mind that 10s shell solutions becomes week long problems the moment you save them into a file. I have complex commands, either stored in a function or grepped from my history ;-) but my initial response was to the author, and anyone who laments the shell's shortcomings for anything more "industrial" than a one liner. I was strictly answering the premise in the fifth panel:

http://shellhaters.heroku.com/#5

"Also, Programming Language"

That it's not. Use your favorite language for your N-liners, for N > 1.




One-off scripts never are. You reuse them and tweak them for slightly different scenarios, then figure, I'll make it a parameter. Then something goes wrong and you add some error checking. Then you show it to someone else or put it in a cron job or whatever and you write some documentation.

Before you know it, your little script is no only a permanent fixture, but other people are relying on it, or its output, or reusing one of its functions. I've seen 10-line file mungers end up as 1000-line batch jobs.

Don Stewart at Galois even advocates using Haskell for what was traditionally done with shell scripts http://www.scribd.com/doc/36045849/Practical-Haskell-Program...


Well, this is how we got stuck with autoconf (of course, then some genius decided m4 was a good idea). Interestingly, sh (at least, the common intersection of all the shells) is a good choice for a language that needs to bootstrap, since pretty much every unix machine has an implementation installed somewhere by default. The way they used it was a little wonky, and if we could go back in time I'd probably suggest generating the configure script from a better language than m4, but it's not the worst of all possible worlds.

That is a cool link, thanks for sharing! Somewhere there's a similar article with OCaml that I never got all the way through, though maybe it was more about systems programming than system administration (so, replacing C, not sh).


'Unix system programming in Objective Caml' sounds like what you were thinking of.

http://ocamlunix.forge.ocamlcore.org/




Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

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

Search: