You are not logged in.

#1 2016-02-02 20:33:42

barefly
Member
Registered: 2014-08-16
Posts: 59

Considering switching to ZSH; What are your thoughts on it?

So I just did a new install of Arch on a new laptop, and something I noticed this time, but didn't the last two times I installed Arch, was that the live usb uses zsh. I really appreciated the "spell check" complete when I made some small mistakes on commands, normally I just use aliases to catch stuff like this, but it got me interested in zsh. I will probably be installing it when I get home later tonight but I figured i'd ask the community about their thoughts on zsh. I'm also interested in knowing any caveats that should be known, or big differences between bash and zsh. What I'm hoping for is just bash with an expanded set of tools and features, but I'm probably wrong in this.

Last edited by barefly (2016-02-02 20:35:02)

Offline

#2 2016-02-02 20:35:09

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: Considering switching to ZSH; What are your thoughts on it?

barefly wrote:

What I'm hoping for is just bash with an expanded set of tools and features, but I'm probably wrong in this.

No, you are right. Just don't go and fsck it up by installing Oh-My-Zsh...


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#3 2016-02-02 20:40:50

barefly
Member
Registered: 2014-08-16
Posts: 59

Re: Considering switching to ZSH; What are your thoughts on it?

jasonwryan wrote:
barefly wrote:

What I'm hoping for is just bash with an expanded set of tools and features, but I'm probably wrong in this.

No, you are right. Just don't go and fsck it up by installing Oh-My-Zsh...

I just found that on the AUR, holy god 180+ plugins and 120 themes?! Who needs all that?

Offline

#4 2016-02-02 20:42:43

Head_on_a_Stick
Member
From: London
Registered: 2014-02-20
Posts: 7,732
Website

Re: Considering switching to ZSH; What are your thoughts on it?

The live ISO uses the awesome grml-zsh-config, I feel lost without it.

Offline

#5 2016-02-02 20:45:57

barefly
Member
Registered: 2014-08-16
Posts: 59

Re: Considering switching to ZSH; What are your thoughts on it?

Head_on_a_Stick wrote:

The live ISO uses the awesome grml-zsh-config, I feel lost without it.

Thanks for the heads up! I'll likely toy around with vanilla zsh before adding anything on to it, but I really like how the Arch live environment feels so I'll likely install this soon afterwards.

Offline

#6 2016-02-02 20:47:33

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,523
Website

Re: Considering switching to ZSH; What are your thoughts on it?

I'd advice against even grml (at least for someone new to zsh).  Build up your own config and learn.

Using either grml or Oh-My-Zsh is just handing of the thinking to someone else. The primary difference being that with grml it seems more likely that you are at least handing off the thinking to someone capable of it.


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#7 2016-02-02 20:52:47

Head_on_a_Stick
Member
From: London
Registered: 2014-02-20
Posts: 7,732
Website

Re: Considering switching to ZSH; What are your thoughts on it?

Trilby wrote:

Using either grml or Oh-My-Zsh is just handing of the thinking to someone else.

Yes indeed, well said.

Also:

empty@Arch ~ % cat /etc/zsh/zshrc|wc -l
3700

It can take a while to parse all those lines on a slow machine wink

Offline

#8 2016-02-02 20:52:50

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,597
Website

Re: Considering switching to ZSH; What are your thoughts on it?

Head_on_a_Stick wrote:

The live ISO uses the awesome grml-zsh-config, I feel lost without it.

+1

Other are too complex and bloated imo.  You can see my zshrc in my sig if you wish.


CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

#9 2016-02-02 20:56:01

WorMzy
Forum Moderator
From: Scotland
Registered: 2010-06-16
Posts: 11,846
Website

Re: Considering switching to ZSH; What are your thoughts on it?

It's not a drop in replacement for bash, so don't go around changing all your bash script shebangs. A lot of the builtins take different arguments, or output in a different format. But in terms of general usage (e.g. subshells, redirection, environment variable setting, piping, etc) it's basically the same as bash.


Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD

Making lemonade from lemons since 2015.

Offline

#10 2016-02-02 21:06:19

Alad
Wiki Admin/IRC Op
From: Bagelstan
Registered: 2014-05-04
Posts: 2,412
Website

Re: Considering switching to ZSH; What are your thoughts on it?

Just go through the wizard on first launch of zsh. You can also look at the zshrc files from other distributions (like Debian's).


Mods are just community members who have the occasionally necessary option to move threads around and edit posts. -- Trilby

Offline

#11 2016-02-02 21:06:19

barefly
Member
Registered: 2014-08-16
Posts: 59

Re: Considering switching to ZSH; What are your thoughts on it?

WorMzy wrote:

It's not a drop in replacement for bash, so don't go around changing all your bash script shebangs. A lot of the builtins take different arguments, or output in a different format. But in terms of general usage (e.g. subshells, redirection, environment variable setting, piping, etc) it's basically the same as bash.

That's good to know. So the majority of my scripts should work just fine im assuming then. Is there a reason I'd ever use a shebang to point to the zsh bin file?

Offline

#12 2016-02-02 21:06:57

Alad
Wiki Admin/IRC Op
From: Bagelstan
Registered: 2014-05-04
Posts: 2,412
Website

Re: Considering switching to ZSH; What are your thoughts on it?

If you want to use features that are only available in Zsh. wink


Mods are just community members who have the occasionally necessary option to move threads around and edit posts. -- Trilby

Offline

#13 2016-02-02 21:12:37

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: Considering switching to ZSH; What are your thoughts on it?

You can write your own zsh scripts using that shebang, to take advantage of zsh features. However, Zsh is not backwards compatible with bash and not even completely POSIX, so don't expect any portability.


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#14 2016-03-01 11:47:19

satai
Member
Registered: 2015-04-21
Posts: 1

Re: Considering switching to ZSH; What are your thoughts on it?

Switching from (ba)sh to zsh for interactive shells is definitelly worth it, mainly with oh-my-zsh. Anyway after couple of years I switched from zsh to fish (with oh-my-fish).

Last edited by satai (2016-10-01 18:02:29)

Offline

#15 2016-03-01 15:25:26

bstaletic
Member
Registered: 2014-02-02
Posts: 658

Re: Considering switching to ZSH; What are your thoughts on it?

I had used fish before switching to zsh. The reason for switching: I get really annoyed by fish' 'and' for joining commands. In comparison to bash both provide amazing completion options and that alone makes it enough for me to switch. I tried grml but at one point just ripped out what I need and am now running a pure zsh. My config is available on my github repo.

Offline

#16 2016-03-04 09:57:50

milomir
Member
From: Serbia
Registered: 2011-09-11
Posts: 17

Re: Considering switching to ZSH; What are your thoughts on it?

zsh is awesome, grml and completions makes life so much easier


Hello Arch!

Offline

#17 2016-03-04 21:26:48

Yannick_LM
Member
Registered: 2008-12-22
Posts: 142

Re: Considering switching to ZSH; What are your thoughts on it?

Happy zsh user here too.

I'm know using this prompt: https://github.com/sindresorhus/pure with nice, async display of git info.

Offline

#18 2016-03-05 02:56:41

Trent
Member
From: Baltimore, MD (US)
Registered: 2009-04-16
Posts: 990

Re: Considering switching to ZSH; What are your thoughts on it?

I use it and like it, but I have to say, if you want to do any scripting with it... well, just don't.

The completion system is capable, but whoever thought it up should be shot and fed to whoever wrote the documentation. (Wait, which completion system? There are two, after all.) The language itself is in that weird territory most shells have, of being nearly-POSIX and having all the weirdness POSIX entails, and yet still adding its own extra weirdness (which, of course, is subtly different from every other shell for no apparent reason except to keep you on your toes). Because it's similar to other shells, all of the available documentation for zsh assumes you already know bash, or ksh, or csh, or something, so they assume you know the basics -- which would be fine if the basics were consistent from one shell to another, but nobody really bothers to consolidate that stuff. I mean, the differences between bash and ksh93 are just obvious! /s

Whatever, I need a blog. Long story short, I stick to Perl and/or Python for scripting if it's going to be more than 1 loop, but for interactive use I haven't found anything better than zsh.

Last edited by Trent (2016-03-05 02:58:50)

Offline

#19 2016-03-07 12:28:12

fumbles
Member
Registered: 2006-12-22
Posts: 246

Re: Considering switching to ZSH; What are your thoughts on it?

I've never used ZSH. To me it seems like Dvorak - a good idea but probably not worth the effort.

If you want to learn it for simply an interactive shell then sure go for it. For scripting, learn Python etc. All shell languages (csh, ksh, bash) stink for anything more than a simple script.

Offline

#20 2016-03-07 12:57:06

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,523
Website

Re: Considering switching to ZSH; What are your thoughts on it?

fumbles wrote:

I've never used ZSH. To me it seems like Dvorak - a good idea but probably not worth the effort.

... All shell languages (csh, ksh, bash) stink for anything more than a simple script.

I agree on both points, though I'd temper the latter.  I stick with bash, not because it is superior, but because it is perfectly adequate and a lot like a QWERTY keyboard, it will be what I have on hand on any system I'm working on.  I do a fair bit of my work on remote servers, very few of which have zsh available - but they all have bash.  So just like Dvorak might make me more efficient on my keyboard, it would leave me fumbling* and frustrated whenever I had to use some other system.

*edit to note: I didn't even realize I was replying to fumbles when I referred to fumbling!


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#21 2016-03-14 22:59:37

0x29a
Member
Registered: 2012-09-28
Posts: 101

Re: Considering switching to ZSH; What are your thoughts on it?

GIven the mess I've on my desktop, using anything other then zsh's visual completion would not make any sense, including icon-based file managers. When it comes to cleaning this mess up, zsh wins hands down too.
Also, it looks beautiful with some ready-on themes. 

For me, zsh changed the way I use my desktop system.
If I do something more then twice, I make a function for it in a matter of seconds. Or tag it in history with nice comment in interactive mode. Instead of clicking around, I use commands chaining all the time. ZSH makes me free from thinking about mundane stuff. Instead, there's only problem at hand and the ways to solve it.
Thanks to the fact that this shell looks so attractive and it seems so comfy, it made me interested in Vim and tiling window managers as well. It transformed me from years-long Compiz user into AwesomeWM scripter. Now I can do stuff hundreds of times both faster and better compared to what I was capable of just a few years ago.

Despite all that, I can see a point that Trilby and fumbles are making. ZSH is a perfect shell for desktop or workstation. If you're doing your work remotely, perhaps on many different systems, then sure there are some things to concider.
However, if you're installing it just for yourself at home, there's no better option, at least in my opinion.
If you had some experience with some other shells, then learning curve shouldn't be that steep at all. 

http://www.amazon.com/Learning-Shell-Sc … 1783282932 << this book is pretty nice when it comes to ZSH scripting. Altough I'd rather go for Lua ( my personal fav ), or some other scripting language. As Trent and others said, ZSH is great in interactive mode, and that's kinda where you should keep it.

Offline

Board footer

Powered by FluxBB