*nix Shells Benchmark

Here's the resluts:
unix.stackexchange.com/questions/148035/is-dash-or-some-other-shell-faster-than-bash/148098#148098

Here's links to the shells:
gnu.org/software/bash/
zsh.org/
busybox.net/
github.com/att/ast
gondor.apana.org.au/~herbert/dash/
mirbsd.org/mksh.htm

Other urls found in this thread:

doc.cat-v.org/plan_9/4th_edition/papers/rc
fishshell.com/
twitter.com/NSFWRedditVideo

Fuck You

ok?

Bash might be shit in terms of performance but at least it just werks

doc.cat-v.org/plan_9/4th_edition/papers/rc

Is performance really an issue with shells? Maybe I'm the oddball in terms of users, but I not did I think to myself: "Damn, I wish Bash were faster".

Zsh is still best

>but I not did I think to myself: "Damn, I wish Bash were faster".
that's because nobody does. It's more like, you find yourself trying a different shell for some reason, and are like "huh, this is quite snappy", then you get used to having that speed. And when you try bash again, it'll feel noticeably slow.

I'd rather use bash because being universal is more important than being slightly faster

>he fell for the ohmyzsh meme

This. Other shells just "feel" faster.
It's probably some kinda placebo, but yeah.
Also for those who are into /minimalism/ almost every shell listed here is smaller than bash.

Not a surprise to anyone
.
Dash for portable scripts.
Bash for everything else that dash doesn't do (since you're expected to have bash on your system anyways).

And as a result - bash for interactive use.
It's "good enough" and even if fish/zsh/whatever is vastly superior using them means you have to learn YET ANOTHER shell which is pointless

I like ubuntu's approach; the default is dash but for anything that requires bash's extra functionality, it switches to bash.

I'm confused. Should i use mksh or ash? I heard ash is faster with tab completion.

I had assumed that just by the output of whatis bash and whatis dash, and the fact they were present in default setup, but wasn't sure.

...

I'm currently using ksh93.
It's pretty nice. The tab completion gives you a neat numbered list, and you can type the number and then hit tab again to complete the option.

yeah dash is pretty bad, mainly due to lacking history and tab completion. busybox's implementation of ash has both of these, at least when I tried it on Alpine.

>not using Alacritty GPU accelerated shell
absolutely disgusting

Alacritty is a terminal emulator. It's not a shell, you brainlet.

>not using ChadShell

>using windows

>has to "learn" something which is 95% the same as what he already knows
t. Brainlet

Is "Chad" an indian name like Rajesh and Pajeet to? I had no idea.

dash/bash for scripts, fish/elvish for interactive use.

>ohmyreddit
Not every zsh user is like that, though I admit they may be a majority

zsh even in its basic configuration is bloated

I'll keep that in mind the next time I mine bitcoins with a shell script, what the fuck are you doing holy shit?

If shell performance matters to you, you're doing it wrong.

literally every shell just werks

show me another shell that can do this kind of shit

desu this is mainly why I switched to zsh, but I'm pretty sure other meme shells have similar features

That ls autocomplete is pretty fucking slick

Fish does that
fishshell.com/

I was replying to the guy calling zsh bloated. By the same standards, fish is bloated. There is little advantage using fish over zsh, besides fish having a better learning curve.

I only defend zsh and fish as interactive shells, though.

Dash is pretty bad for frontend use but great for system use.

Why do you need your shell to do that kind of shit? It's like the desktop switcher cube, might seem interesting the first time you see it but utterly useless.

Cycling through autocompletions is incredibly useful

>bash
>universal
Are you on drugs? It's generally only used on GNU/Linux, not other Unix-like OSes.

Not really, no

>TAB TAB TAB TAB TAB TAB TAB
>TAB a TAB b TAB

WHATS THE FUCKING DIFFERENCE BETWEEN KSH93 AND MKSH RREEEEEEEE

I'll attempt to explain, although I'm sure someone will correct me.

Ksh (the original AT&T UNIX one) was originally proprietary software.
Because people wanted a free one, they made pdksh (public domain ksh) as an attempt to recreate it.
I believe this led to two forks which are the other kshes. Those would be OpenBSD's ksh (their default shell, available on loonix as loksh), and MirBSD ksh (mksh).
Eventually, AT&T released the original ksh (ksh93) as Free Software under the Eclipse Public License, and is currently being developed on github.

So to sum up, there's a total of four kshes. ksh93, which is the AT&T one, pdksh, which was the old attempt at replicating it, loksh, which is OpenBSD's fork of that, and mksh, which is MirBSD's fork.

From a user standpoint, Mksh/loksh feels a bit faster, although the benchmark says it's slower. ksh93 is also the only one with the numbered list thing like the post you replied to. The tab completion on the other kshes is pretty basic, for better or for worse.

also, ksh93 uses slightly more ram (only matters if you're autistic, but then again you'd have to be in order to reply to this thread), but it also has some unique shell scripting features apparently, such as floating point arithmetic.

Damn user. You explained it really well. Thank you! I'm gonna stick with mksh because suckless suggests it(suckless.org/rocks).

What are your thoughts on busybox's ash shell?

busybox ash is weird.
On Debian and Alpine, it has history, as well as tab completion.
On Void, it has history, but no tab completion.
I guess it's just a compile option or configuration I don't know about? also I have no idea how to set it as default shell on non-alpine platforms. Alpine has it as default shell, as well as using busybox's coreutils, but for other distros, I'm not sure how to do it (chsh doesn't accept it.)

>On Debian and Alpine, it has history
>On debian, it has history
>has history
Yeah, FUCK ASH.

...

Mksh is perfect for me user. It's very fast, has tab completion and no history

mksh has history though

History means a log of commands entered.
Press arrow up and you get the last command.
Start typing and press arrow up and you get the last command with the same prefix...
Stuff like that.
He clearly didn't mean "it has a long historical context"

user you don't seem like a brainlet at all. What distro do you use?

I don't know what he uses, but i'm and I wish I could use a distro full time, but some circumstances prevent me from doing that. I currently use Void in a VM, with MacOS as the host.

I use Ubuntu LTS. It is what everyone uses at my work, so I use it too. Is that supposed to discredit me?

kek, are you that "uwu" fag? Im the OP of the minimalism threads

>(chsh doesn't accept it.)
come on now, read the chsh man page
>chsh will accept the full pathname of any executable file on the system. However, it will issue a warning if the shell is not listed in the /etc/shells file. On the other hand, it can also be configured such that it will only accept shells listed in this file, unless you are root.

Which uwufag? I'm not illyaposter. I post cute shota boys

hmm, did you also install debian and use frankenwm?

yep! same user.

ok I tried it as root and it gave me the warning, then I logged out and tried to get into the user account again and it wouldn't log in. kept saying "Login incorrect" no matter how many times I tried.
Logged in as root again, changed the user's shell back to ksh, and then it accepted my login.

So, why can't use a distro full time? Really curious

because I need some proprietary shit that isn't available on Loonix whatsoever.

Another question, why are you GAY?

I'm bi, but as far as why, I dunno.
Pretty much always been that way tho

Linux is by fare the most popular unix-like platform, so he's still not wrong.

It depends.
One thing I notice all the time is startup time.
I once had a system where sourcing the bashrc took so long I typically typed a few letters before the ps1 was set which was damn annoying.
But no, speed of execution does not matter in most cases.
What does matter is ease of use.
Autocompletion, searching in history, aliases, hotkeys, stuff like that is what matters to most users.
The "problem" with multiple shells is that you might end up using some feature in a script that is not the same for other shells.
And while using a niche shell is good for you, telling people to install that shell in order to run the script you just wrote makes you seem like a lunatic at best or incompetent at worst.

mksh is a ksh88 clone. Korn added many useful features between ksh88 and ksh93, and none of the clones added much from ksh93

>believe this led to two forks which are the other kshes. Those would be OpenBSD's ksh (their default shell, available on loonix as loksh), and MirBSD ksh (mksh).

Minor nit-pick/elaboration on that: mksh was a fork of OpenBSD's ksh specifically, because OpenBSD didn't want to merge it into their code for some reason. There were some politics involved that made the mksh author shady or some shit, I don't really know because I don't have the autism to go through old mailing lists for the details, but yeah.

Though mksh was audited or some shit in order to become the standard Android shell, along with OpenBSD's userland utils. So make of all that what you will.

that's actually weird
you could try editing passwd directly, but do that at your own risk
too lazy to go look into this shit myself right now, it's like 4am

>I use Ubuntu LTS
yeeeeeeaaaahhh... that's Sup Forumsonna be a bit of a problem.

Plan 9 rc shell for interactive uses,
dash for else.

Would using dash instead of bash also increase the performance of vim slightly?

I think part of it might be that busybox ash is not a standalone program. You launch it as an argument to busybox (literally type "busybox ash")
also heres a boy owo

How to translate bash scripts to dash?

Debian created a utility called checkbashisms that could help.

By hand. Bash is chokfull of bash-specific features that in a lot of cases make scripting a lot easier but in return sacrifice portability.
Two utilities you should get used to using before getting proficient with shellscripting are shellcheck and checkbashism scripts (part of the debian devscript package)

Good luck with that. When I ran bashisms on my tiny system hundreds of scripts came up. It's too much work to make them all follow the posix standard.

Linux is just a kernel.

Sorry, stallmanite cuckboi,
GANOOOO +/ LoOnUx

Thats crazy. There is a bash 2 python translator, but not a single bash -> sh?!

To use yes.
But the code is fucking shit. Just look at it.

>I typically typed a few letters before the ps1 was set which was damn annoying.
that shit will drive you nuts. had the same problem with my zsh setup
these days I'm on mksh with a light .mkshrc; always instantenous startup, though I miss the case-insensitive, match-anyware autocompletion of zsh

until it's just an extra step that's constantly getting in your way.

Ubuntu LTS and Debian Stable are topcomfy.

Zsh is once again proven to be the superior shell, as it boasts the most complete feature set while being only marginally slower than everything except dash, and about 1.5 times faster than bash