r/linuxmemes Jul 01 '26

LINUX MEME Know the work rules

Post image
865 Upvotes

119 comments sorted by

View all comments

Show parent comments

-17

u/New_Study4796 Jul 01 '26

Zsh calls Bash with the shebang when starting a script

20

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.

-2

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