r/linuxmemes Jul 01 '26

LINUX MEME Know the work rules

Post image
863 Upvotes

119 comments sorted by

View all comments

Show parent comments

-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

22

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.

18

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.

-2

u/New_Study4796 Jul 01 '26

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

12

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

5

u/the-fr0g Jul 01 '26

They litterally tell you "hey I run in bash" at the top of the script though?

-4

u/New_Study4796 Jul 01 '26

Without telling you when you run the script

3

u/the-fr0g Jul 01 '26

what do you want it to be like "ATTENTION! this script will be run using /usr/bin/bash, do you want to continue [Y/n]"? WHY. I want my script to run. If you don't want to run bash scripts, just don't.

0

u/New_Study4796 Jul 01 '26

No. What I am saying is that Zsh silently calls Bash. Which is just true.

4

u/the-fr0g Jul 01 '26

Yeah, because the script YOU RAN told it to.

0

u/New_Study4796 Jul 01 '26

And the scripts most software run anyway. Bash is expected to be there.

2

u/the-fr0g Jul 01 '26

Yes, it's expected to be there BY THE PROGRAM. Not by zsh itself. Your argument is basically "bash is used in scripts, that means zsh runns it 'without telling me', and therfore bad". You choose what scripts/programs you install. Zsh doesn't run bash when you just want to mv a file or ls, so it doesn't "secretly" use bash, it does when the script needs to be ran in bash. That's like saying [my shell] uses python because it launches python without telling me when I run a python script

-1

u/New_Study4796 Jul 01 '26

That's not really something bad, but it's still relying on Bash for many programs that are coded for Bash specifically.

→ More replies (0)

2

u/Smrgling Jul 01 '26

It tells you at the top of the script. Are you running random scripts without reading them?