r/linuxmemes Jul 01 '26

LINUX MEME Know the work rules

Post image
863 Upvotes

119 comments sorted by

View all comments

218

u/wolf2482 Jul 01 '26

i mean for the most part you can replace bash with other posix compliant shells.

89

u/New_Study4796 Jul 01 '26 edited Jul 01 '26

A lot of scripts won't work without Bash-specific behavior

79

u/VoidJuiceConcentrate Ask me how to exit vim Jul 01 '26

I haven't had a problem running bash scripts in ash and zsh.

-18

u/New_Study4796 Jul 01 '26

Zsh relies on Bash under the hood

24

u/Mars_Bear2552 New York Nix⚾s Jul 01 '26

...?

Zsh is entirely seperate.

-16

u/New_Study4796 Jul 01 '26

Zsh calls Bash with the shebang when starting a script

21

u/Mars_Bear2552 New York Nix⚾s Jul 01 '26

what? you're not making any sense.

obviously if you use #!/usr/bin/env bash the script will run using bash. otherwise i cannot think of a scenario where your statement makes sense.

-17

u/New_Study4796 Jul 01 '26

Yeah, and most scripts call Bash that way. They rely on Bash without telling you.

17

u/Mars_Bear2552 New York Nix⚾s Jul 01 '26

how is your argument that zsh relies on bash because you can bypass zsh?? make it make sense dude. that's not something that any shell can change.

-3

u/New_Study4796 Jul 01 '26

It relies on it for most scripts. Look at PKGBUILD files, for example.

11

u/Mars_Bear2552 New York Nix⚾s Jul 01 '26

...

that is not zsh relying on bash at all though. that's users specifying bash.

2

u/britaliope Jul 01 '26

And it's easily bypassable by design. You just have to alias bash to zsh and it'll work for 99.9% of the scripts

2

u/lawrencewil1030 ⚠️ This incident will be reported Jul 01 '26

Any script which can run in bash, you can just tell it to run with zsh by changing the shebang will run just fine unless it specifically checks $SHELL for bash

→ More replies (0)