Hacker News new | ask | show | jobs
by uuid_to_string 4439 days ago
What if you invested in learning a shell that was installed on all servers you lack control over?

What if you invested in learning POSIX sh?

Wouldn't your scripts and one liners written in POSIX sh work in zsh, bash, etc.?

You could be comfortable on any server, no matter what the shell.

Even servers that default to tcsh still have /bin/sh.

1 comments

I'm not saying don't do that, and I'm comfortable using and scripting for anything from POSIX sh to zsh, can get by in fish, etc, etc.

But if you're going to dive deep on any of them, bash has a pretty unique and strong argument for being quite likely to be available on most of the machines you work with on a day to day basis.

By "you" do you mean me, personally?

The servers I use do not have bash installed by default.

The only time I use it is when I am forced to by an installation script.

I install bash on an as needed basis, and when I'm done using it, I uninstall it. I just have no need for it otherwise.

What is the shell on Android? Is it bash?

No, definitely meant it as a general thing. And really, directed towards people working with servers, and not to people working with embedded devices (like Android) where keeping to POSIX (or specifically ash, which is what android and busybox use) is probably a necessity.

Many servers don't have bash installed as part of their base distribution, but if they're going to have another shell already installed it's much more likely to be bash than zsh.