Bash is Bloated!

preview_player
Показать описание
Рекомендации по теме
Комментарии
Автор

Why did you even need a shell? Just send your instructions to kernel itself.

danilovilasboas
Автор

The biggest hurdle with writing POSIX shell scripts is that searching for anything shell related will lead you to bash specific answers.

simonmikkelsen
Автор

bash is one of the slowest shells?


oh man it feels like lightspeed if you have to use the Windows commandline regularly...

bruderdasisteinschwerermangel
Автор

Shellcheck? That's a Haskell program! You're willing to install Haskell to use this simple tool...but Bash is bloated? ;)

DistroTube
Автор

Dont even bother scripting, just write everything in C

mattwilliams
Автор

*crack* Ah, sh. *sips* that was a good shell.

reallybadmeme
Автор

Bash is actually resonably fast if you stay in the shell.
When you use externals a lot (grep, sed, awk, head, tail...) Bash is SLOW....
Also, The Regex operator in bash is =~ try it. I have been rewriting a lot of scripts to use this
instead of grep, sed, awk etc. Especially my web scrapers.
It understands Extended Regular Expressions, ERE and creates an array with the matches it finds.
Have fun and always keep learning.

jamesharrison
Автор

For those wondering, there are benchmarks in stackoverflow and dash takes about half or even a quarter of the time to run. Not huge in my opinion but a nice way to speed things up. Anyway if you want speed it seems like trying to stick with awk whenever possible is best

Pabloparsil
Автор

It's a very important topic. One thing you may want to look at moving forward, is that while sh is always going to be in /bin/sh ; bash might not be.
In BSDs you'll find bash in /usr/local/bin/bash
There is an easy solution, that is actually best practice for cross-platform compliance, is to use the `env` command.
`env` returns the value of the binary in your environment. It is always in /usr/bin/env - see below for how to use it in a bash script, that will work, cross platform. :)
#!/usr/bin/env bash

GibranKhanOriginal
Автор

When you’re so posix compliant you don’t know if the world is real.

drumpfall
Автор

The virgin microprocessor vs. the chad abacus.

fn-ix
Автор

Hi, mksh developer here ☻ thanks for the mention!

Note that mksh does implement a few bashisms (just as bash implements things like [[…]] which are kshisms), but not this one; diff between two processes is actually the only time I temporarily switch to GNU bash myself.

For better performance, link mksh statically (beats dynamically-linked dash in speed even!) and add the optional printf builtin, which you’re going to be using a lot in POSIX scripts unless you actually check for the ksh print builtin first and use that if present. Note that the printf builtin does not and cannot have floating point (%f) though…

mirabilos
Автор

Thanks for making this video. Especially thanks for not using a giant mostly empty frame to sow what amounts to text. So many people make those and they’re damn hard to watch without full screen on a desktop. This was watchable ON MY PHONE!!! Awesome.

johnjoyce
Автор

Yeah yeah bash is slow. But who writes CPU-bound scripts in bash anyways? Process substitution is a killer feature.

Madinko
Автор

This is the first time ever I've heard Bash or a shell for that matter is slow. You had my curiosity, now you have my attention.

tosemusername
Автор

A bloated shell will use more battery life per process because it requires more power so dropping bash might gain someone a little better battery life on their laptops. Sure, it might not be much, but as any system engineer knows the less a cpu has to do, the less power it will use.

PearComputingDevices
Автор

3:37: Process substitution isn't (just) a bashism, it's a Korn shell innovation; bash just copied it from ksh88 or ksh93 (and enabled it by default).

ropersonline
Автор

There are two POSIX shells /bin/sh which should be a Bourne shell and /bin/ksh which should be a Korn Shell. ksh is the POSIX extended shell. Many systems do have a ksh type shell as bin/sh but not all and this is less common UNIX unix. bash started out as a ksh clone, it's gotten quite fat and slow over the years though.

rednight
Автор

"Bash is Bloated!"
> uses bash
🤔

schukaproallied
Автор

If you're having to worry about performance while using bash, then you shouldn't be using bash.

notiashvili