Lies I was told about ZSH and Bash

preview_player
Показать описание
Shell Myths:

ZSH is a newer version of Bash
ZSH has completion and Bash doesn't
ZSH has prompt themes and Bash doesn't
ZSH supports plugins and Bash doesn't

Zsh & Fish Are A Trap: Learn How To Use Bash First

You Really Don't Need Oh My Zsh And Here's Why (Rant)
Рекомендации по теме
Комментарии
Автор

zsh is really annoying to program scripts for, especially if trying to be compatible across multiple shells. Most Bourne-style shells behave like bash, dash, ash, and ksh in that (1) words are split with spaces (in zsh, you have to use 'setopt shwordsplit'), builtin and command behave entirely differently in zsh. and $0 changes to the name of the script that sources it rather than staying the name of the script run from the shell, which gets challenging when differeny subscripts source the same library script. I find the interactive terminal usage differences in zsh trivial (and you correctly show they can be implemented in Bash). I think for anyone who's serious about programming and not just using a terminal, Bash is the way to go. A bash script can be made to work with relatively little modification in dash, ash, and ksh, and the fact that zsh behaves so differently quickly becomes an annoyance to anyone who's had to write anything short of a couple one-liners (i.e. libraries, installers, etc.). I'm pretty sure there's a good reason the developers of Got and Linus Torvalds (AFAIK) try to stick to Bash: it pretty much just always works and is not a major pain to code.

adamhendry
Автор

I've never heard any of those claims. But anyway, zsh completions can actually get rather fancy, for exampe you can get descriptions/usage instructions for flags when you do something like `ls -<tab>`, bash can display the flags but not the descriptions. Of course this requires that the author of those completions have filled those in, which is often not the case because the completions are just bash completions ran through an adapter layer thing. Writing zsh completion scripts is a lot easier than to write them for bash, but that's not something a lot of people are going to do by themselves. Most of the tricks you can do in a zsh completion script you can do in a bash script, but it's going to require jumping through some weird shaped hoops. Other than that, there's really not much difference between those two. Fish is more different, sometimes different enough that you can't directly copypaste a command example, but it has some really neat stuff in it.

kke
Автор

For me I don't think a couple of extra built-in features outweigh the downsides, like arrays starting at 1. Everyone already uses bash, and probably for good reason.

kb-zealot
Автор

That syntax highlight plugin is actually an attempt to emulate one of Fish's native features. Since this video is about shells, I tried Fish for a while and it was really cool. Too bad it isn't POSIX-compliant though. Sometimes it caused issues. Not too often, in fairness, but often enough to be annoying *for me*.

brainplot
Автор

8:24 this "fish-style"(?) syntax highlighting is what I was hoping to find amongst the bash Myths.

Seems simple, but I'm not sure accomplishing it without some tradeoffs would really wind up being a "bash" solution.

toastybowl
Автор

How did you make your terminal look like that?

synergydev
Автор

Hi. I've tried zsh a couple of times for interactive use. It doesn't have anything over bash. All plugins people use with zsh are features that are default in bash, it's just that people don't know how to use it. For instance, many people don't know how to use the GNU readline properly. Ctrl+R is better than the annoying zsh suggestions. I also use a tiling wm so I fire up terminals constantly and there's a delay between the time terminal opens up and the time zsh prompt appears. It's a delay that I can easily feel. If you want performance, you should avoid oh-my-zsh like the plague, which beats the purpose of using zsh and it's still slower than bash.

mihaiisvoranu
Автор

Have been using zsh for the past 15 years for my scripting / work / private stuff. If I had to write highly portable install.sh or similar scripts I'd stick with /bin/sh but then again I'd prefer python for that if I could.

TJ-hsqm
Автор

Man, I'm a complete newbie strugling with customizing my bash
Would you make a video, or playlist, showing how?
Thanks!

maurolimaok
Автор

This video will save lives.

EDIT: I think this statement doesn't make sense by itself so allow me to elaborate. Today a guy can install arch in a single day without understanding anything or even reading the arch wiki with the help of unlimited misinforming youtube videos. A guy will probably install yay or paru without understanding building packages or reading the pkgbuilds. They probably don't even have a reason to switch to linux other than being influenced by content. So many people nowadays lack the basic undestanding of opensource philosophy. The fact that opensource is safe stems from people reading the source code and understanding whats going on under the hood. But today even developers have forgotten how to code with unlimited libraries and unnecessary complicating abstraction.

Basically what I am trying to say is installing Oh my zsh and thinking its a framework adding functionality to the shell while all it does is add scripts - scripts you could add to any other shell - scripts you no idea what they do - scripts that could have malicious code hidden in it - without even trying to understand them is harmful to the community.
Unless you need something to work out of the box right now please take the time to understand your tools because youre part of the community and this whole thing is made and maintained by the community. Whenever a software is trying to make things abstract they are taking control away from you and ultimately making you dependent on their methods.
Used to be a time when people would fork left and right to make things do what they want them to do.

ryce
Автор

which font are you using.. it is so awesome

akshaypai
Автор

Be careful you say that my Bourne shell might actually be BASH hahaha that's good stuff man

scottbisco
Автор

Well, completion doesn't end with tab completion. It uses a pretty common plugin called autosuggestions, which predicts the command you are typing and shows it as virtual text. You can directly execute the predicted command.

I don't know a plugin which does this on bash. So we can say that zsh has much better completion.

Feel free to oppose me.

MrLafinte
Автор

At 1:54 you mentioned Nushell. Do you have a video about it too?

jabuci
Автор

That error syntax highlighting might actually be the one thing that convinces me to switch! I've had a million people try to tell me that zsh was better, but I never really appreciated any of their arguments. I'm not really a fan of the interactive style of completion, which definitely seems to be one of the bigger draws. I prefer to work in proactive instead of reactive way, so I see muscle memory that gets me to type the thing I want instead of reacting to a list as better overall.

mattheasboelter
Автор

Subscribed because the only real thing that matters is zed > zee

latergator
Автор

you can do prompts on the right with bash

swwqlhw
Автор

never heard any of these myths.. I use zsh all the time though

jongdonglu
Автор

Thank you for this video. The best overview of the zsh on YouTube.

M_E_JI_K_A_I_I_I_K_A
Автор

I didn't make it through the whole video, but I did see that you passed on a perfect opportunity to tell people who don't know the full name of bash, which is one of the best naming puns in history: The Bourne-Again Shell. Maybe you said it later. Maybe you assume everybody knows. Maybe you don't appreciate the naming pun as much as I do.

johningram