this post was submitted on 16 Jul 2023
182 points (97.4% liked)
linuxmasterrace
2050 readers
1 users here now
A community for Linux enthusiasts.
May your htop stats be low and your beard grow long
Welcome to [email protected] former r/linuxmasterrace members and existing Lemmyverse citizens: Feel free to join the newly created [email protected] community.
Let’s make the full transition to the decentralized Fediverse!
founded 1 year ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
Okay, you guys get the once in a liftetime chance to convince me that Bash is not the way to go. I'll eagerly await your proposals.
What if there happens to be a command with the same name?
command goes first
order is shell built in > path > autocd
Then you're likely to enter a command by accident. I would consider that a dangerous misfeature and look to turn it off.
not really tab complete puts a / at the end of autocd directories
Can you not type in the name of the hazardous folder yourself? I'm envisioning trying to autocd into a folder named
reboot
or something.then you would type
reboot/
Does autocd not work without a slash at the end?
it does but if you had a file called reboot tab complete would complete the reboot command and not put the slash thwre, adding the slash specifies that it's a directory
I've got syntax highlighting enabked, so I always notice the different color when I type a commnand.
Don't name your directories "rm" or "fdisk" problems solved
Until I forget about some command or another, and accidentally give a folder the same name.
Don't name your directories "rm" or "fdisk" problems solved
Some of those options exist in Bash too, but need to be enabled in your profile: https://www.gnu.org/software/bash/manual/html_node/The-Shopt-Builtin.html. Bash is also more like to be available on random machines that you have access to. Lastly, if you’re working a lot with Bash scripts in your (work) environment you might feel more at home using Bash in interactive mode too.
Those are just some counter arguments for the sake of completeness. I think zsh is great, even though I personally don’t use it (yet).
OK GPT, now give me 7 reasons why Bash is better than zsh, please!
Yeah, from the first line
This screams AI-generated.
Automatic cd isnt a zsh-only feature. You can use it in bash by
shopt -s autocd
. Afaik its also disabled by default in zsh, just enabled by oh-my-zsh.Hi, how can I install zsh in Windows 10?
There are two massive points no one has mentioned yet.
$array
actually expands to every element in an array.Compare this between Bash and Zsh:
Very convenient. But ~every shell script is written in bash or POSIX(y) sh. When I need to write shell scripts I begin with busybox sh compability. If it turns out to be too complex, I'll convert to bash. This is because if I ever would publish the script it would have better changes to be accepted as a PR for example. Yes. Bash is a mess. I don't even like it that much. It's okay. But it's more standard then zsh. Although I've seen the tides turn on some occasions, like macOS.
Maybe some day I'll give zsh a second chance.
I used to write Bash more than anything, but now the things I write are either simple enough to keep POSIX or complex enough that I miss the extra niceties Zsh provides.
Well said!
Bash is the way, zsh if you are lazy.
sh scripts can be run in even the dumbest distro out there, bash, not so much
The debate was between zsh and bash, not necessarily POSIX sh.
This is me but for fish shell.