Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I'm not sure the book is actually about bash specifically, but let's talk about shells anyway.

The existence of zsh makes it all a pretty unsatisfactory situation currently. (Btw re. my own level I know the answer to most of the questions posed in the article).

I'd be fine learning either bash or zsh to an advanced level, but learning both to an advanced level sounds bonkers. So I've vaguely come to the conclusion that perhaps that means learning zsh well as a command line tool, and then limiting ones shell scripts to a sane subset of bash that is sufficiently small that you don't need to fully know advanced bash. But then, I don't actually like learning advanced zsh. It seems like a silly language full of completely ad-hoc syntax. Nevertheless, I do use zsh as my shell, I think mainly because tab completion is better.

(I went heavily into nushell, but at the moment it's too different from what one's colleagues are using so it can only be an auxiliary to POSIX shells, and I decided it was a time sink I couldn't afford.)



The solution you want is to target posix compatibility; you can choose how strict you want to be with that (ie essentially every posix compatible shell also supports the `local` keyword).


In order to be sure that your scripts work across most of the shells, you can also aim at POSIX compatibility.




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

Search: