Opinion piece: Bash is a fundamentally bad shell
#1
Opinion piece: Bash is a fundamentally bad shell
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.

I'm the system admin of this site. Private security technician, licensed locksmith, hack of a c developer and vintage computer enthusiast. 

https://contrib.irixnet.org/raion/ -- contributions and pieces that I'm working on currently. 

https://codeberg.org/SolusRaion -- Code repos I control

Technical problems should be sent my way.
(This post was last modified: 10-28-2021, 01:50 AM by Raion.)
Raion
Chief IRIX Officer

Trade Count: (9)
Posts: 4,240
Threads: 533
Joined: Nov 2017
Location: Eastern Virginia
Website Find Reply
10-27-2021, 05:07 PM


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)