IRIX Network Forums
Opinion piece: Bash is a fundamentally bad shell - Printable Version

+- IRIX Network Forums (//forums.irixnet.org)
+-- Forum: Other Platforms (//forums.irixnet.org/forum-5.html)
+--- Forum: Other UNIX (//forums.irixnet.org/forum-30.html)
+--- Thread: Opinion piece: Bash is a fundamentally bad shell (/thread-3195.html)

Pages: 1 2


Opinion piece: Bash is a fundamentally bad shell - Raion - 10-27-2021

The bourne-again shell, bash, is unfortunately synonymous with UNIX because of GNU/Linux. It's no secret I'm a tcsh fan, but setting that all aside (this is not a comparison of any one shell, but rather a critique of GNU bash itself and why it should not be used either as a scripting or interactive shell.) I'm here to write a list of reasons on why Bash is bad, and you shouldn't use it.

Dependencies: Fundamentally, GNU bash relies on more "stuff". It rivals zsh in size, complexity and dependencies. The main offender is GNU readline. On top of bash being a massive shell consisting of tens of thousands of lines even in the 1.x series, it has to use a library libreadline to get any of its extended features done. Just in C code alone, the readline 8.1 package is 25,610 lines of code. So basically, going to 2.05 for instance, that's basically around the same size as bash itself. You may be thinking to yourself "But Raion! Not all of the library is actually used at runtime, shared libraries!"

Bullshit. If you want bash as a root shell, it needs to be statically linked.

Speed: Because Bash is a fatass, it tends to be weak in areas of speed. Customize your prompt, resources, etc. and that affects shell startup time. It also affects scripting. Bash is a backwards compatible clone of korn and bourne shells, which means it has to support their featuresets in addition to its own. The burden of backwards compatibility is fat, and this applies to zsh and such as well. I'm honestly curious how many of the "bash scripts" out there wouldn't work in a ksh variant, either straight or with minimal editing.

Inclusion: Not only is it not included on IRIX, but the BSDs, Solaris, HP-UX, MINIX, and pretty much nothing with GNU utils shipped with bash -- trying to replace or use it on those systems is a lot like going to Advance Auto Parts and putting a short-ram intake on a car because HORSEPOWER -- when it usually doesn't do anything.

Features Elsewhere: What do you depend on in your shell? For me, it's colored prompt, tab completion of files, history unification, and repeating last arguments. That's all supported in tcsh, ksh, and pretty much every shell besides the bourne shell clones like osh, dash etc. Unless you're really specifically using emacs editing modes (and I guess statistically such things have to exist) or some obscure part of the shell's definitions that don't exist in ksh93 (Which admittedly is a shitty build system) or mksh or whatever.

My conclusion and closing remarks are for most users, bash is irrelevant and doesn't itself bring anything new to the table for most users. It's only used out of normativity and usage on other systems is because people expect the exact same operations.

I myself use ksh for scripting, and tcsh as an interactive shell.


RE: Opinion piece: Bash is a fundamentally bad shell - Shiunbird - 10-27-2021

Honestly, the first thing I do when I get a new system is to install Bash.
Not that I love or hate it, but since my work can technically being described as a glorified sysadmin (enterprise architect, lol), I do write a bunch of scripts and I'm trying to use spare bandwidth to learn C and OpenGL. =) Not going to relearn it at this point.
So, yes, I fit exactly your diagnostic of why it's heavily used.

HOWEVER -

Your post got me very curious on why Apple replaced bash with zsh. Does anyone know?


RE: Opinion piece: Bash is a fundamentally bad shell - Raion - 10-27-2021

License. Bash was stuck at 3.2. Because they hate GPL3.

But what I'm trying to tell you and half the people here who do that sort of thing is that you don't actually require it. Tcsh is pretty much the same thing unless you require for loops on a regular basis


RE: Opinion piece: Bash is a fundamentally bad shell - s0ke - 10-27-2021

(10-27-2021, 05:36 PM)Shiunbird Wrote:  
Quote:I do write a bunch of scripts and I'm trying to use spare bandwidth to learn C and OpenGL. =) Not going to relearn it at this point.

And we admins are an inherently lazy bunch. I agree I don't love it or hate, but I use it because it's what I've used. I'm to old and lazy to change now Smile 



RE: Opinion piece: Bash is a fundamentally bad shell - shrek - 10-27-2021

I like mksh. In my experience it's almost twice as fast as bash while still being largely compatible and with enough features I'm not missing anything. I also like the minimal set of defaults it comes with (at least on Debian). The documentation is very nice and prompt configuration is very easy.

Bash isn't terrible but unless I specifically need it for something it does kinda feel like a waste of CPU cycles, RAM and a few seconds of my time...


RE: Opinion piece: Bash is a fundamentally bad shell - Raion - 10-27-2021

It's not like you have to relearn everything either and I want everybody to keep in mind that this is just my opinion because I'm tired of having to tell people that you shouldn't use it on anything that it didn't come with stock. It's problematic.


RE: Opinion piece: Bash is a fundamentally bad shell - Shiunbird - 10-30-2021

Oh, I'd not say that it's fair to say that I am lazy.
I'm still every day trying to learn something new.

But my daily job has been being quite unsatisfying, so, well, I focus on learning something that will actually give me the ability of doing something new instead of being more efficient for zero increase in salary.


RE: Opinion piece: Bash is a fundamentally bad shell - Raion - 10-30-2021

That's s0ke who said it, not me Biggrin


RE: Opinion piece: Bash is a fundamentally bad shell - Shiunbird - 11-01-2021

You know what's interesting for me in our discussions here...

Firstly, we all observe things from a different perspective and I often realise I don't question why things are the way they are all that much.
And secondly, we get to where we are after decades of decisions piled on top of each other and it's nice to pull the thread and see where it goes.


RE: Opinion piece: Bash is a fundamentally bad shell - Raion - 11-01-2021

I suspect living with OCD has played a major part in my experience as a tech user. I am constantly looking to break things down into nuts and bolts. My ability to visualize things in a linear manner and also a disassembled manner makes it easy for me to examine things people overlook, and that's why I suppose I find macOS detestable, windows tolerable-ish, GNU/Linux not ideal and the BSDs and Illumos more ideal due to their closer resemblance to IRIX, AIX and Unixware. The reason I find Windows tolerable, is because as shipped it doesn't try to hide power user abilities behind undocumented commands and it's possible to remove 90% of the visual effects that are bothersome to me.

Sure the zoom function of the macOS dock and the genie-like minimize were cool to me when I was like 13, then I had to use it... And I found myself disappointed.

While obsessive compulsive disorder is an incredibly annoying thing to have it also has given me a unique perspective. It's not a mental illness, and it's not dangerous. It's a specific defect of the mind that results in a different mental profile.