Live data from Hacker News

Moving to zsh (2019)

scriptingosx.com

31–40 of 45 posts

Re: Moving to zsh (2019)

#31

First thing I do for any *nix install is immediately install Fish. Like many younger computer users I prefer rainbow barf.

I tried fish and really liked it until I tried to run one of my numerous helper scripts and was faced with syntax error; too lazy to update so many scripts.

Did you try "bash " or adding a #! line, which scripts should generally have anyway?

Re: Moving to zsh (2019)

#32
I like zsh and it’s my choice of shell.

But at the same time I feel it’s too close to bash.

I can still run bash scripts, so why does everything at the command line have to be almost, but not quite bash?

I think it would be nice with a bit more of a paradigm switch that could open up for some new interactive possibilities. But bash alternatives seems to be mostly a better version of bash for some definition of better.

Re: Moving to zsh (2019)

#33

I've switched from bash to zsh a few weeks ago and overall, I'm pretty happy. Menu based auto completion for example is extremely nice. But I could never get auto complete for rsync to work. I have some hosts in ~/.ssh/config (think "Hostname prod01" etc) , and in bash auto complete works for ssh, scp and rsnyc ("rsync prod01:someFile .") In zsh, this only works for scp and ssh, but not rsync, and I haven't found a w…

I don't have a magical solution since you didn't give much context. I suppose that completion is enabled (compinit, complist) and generally working since you mentioned it for ssh & scp. Maybe you're just lacking the file that contains the completion instructions for rsync. It should be named "_rsync". In my case, Debian's "zsh-common" installs it in "/usr/share/zsh/functions/Completion/Unix/_rsync".

Re: Moving to zsh (2019)

#34

Earlier quoted context omitted.

I think that’s Linux-only, right?

It's in the /dev/ folder so it looks like a device file provided by the operating system. But it's not. It's a bash built in pseudo file. So it should work in bash on other operating systems.

Nice thing to learn - thanks. Although the only scenario I can think of at the moment would be the lack of netcat (and telnet).

Not a fan of limiting scripts with bashisms. I like them to be runnable under zsh and similar shells despite having /usr/bin/env bash, /bin/bash, /bin/sh shebang.

Re: Moving to zsh (2019)

#35

Earlier quoted context omitted.

It's in the /dev/ folder so it looks like a device file provided by the operating system. But it's not. It's a bash built in pseudo file. So it should work in bash on other operating systems.

Nice thing to learn - thanks. Although the only scenario I can think of at the moment would be the lack of netcat (and telnet). Not a fan of limiting scripts with bashisms. I like them to be runnable under zsh and similar shells despite having /usr/bin/env bash, /bin/bash, /bin/sh shebang.

A more sneaky use case is for reverse shell payload when you have code execution :)

Re: Moving to zsh (2019)

#36

Why is zsh forced on users anyway? Are there known issues with bash? I’m sure there are - anyone have a link?

The article mentions it is because Bash went to GPLv3 and Zsh is MIT, and Apple is (my words) allergic to GPLv3. They avoid it everywhere. (Which tells me its a fantastic license.)

Re: Moving to zsh (2019)

#37

Good stuff, but, conversely, one may just manually set any user's default shell [1] back to bash, or Bourne, ksh, csh, tcsh, or install and use another as a default shell, such as fish, nsh, nushell, rc, yash, etsh, and so on and so forth. [1] https://www.howtogeek.com/444596/how-to-change-the-default-s...

I prefer Fish.

And with xxh (or Nix) you can take it with you to a ssh session near you. There is also a couple of plugins in OMF and Fisher to fix some bashisms Fish is missing.

Re: Moving to zsh (2019)

#38

First thing I do for any *nix install is immediately install Fish. Like many younger computer users I prefer rainbow barf.

I tried fish and really liked it until I tried to run one of my numerous helper scripts and was faced with syntax error; too lazy to update so many scripts.

Same for me, later I switched back to zsh after I discovered this plugin:

https://github.com/zsh-users/zsh-autosuggestions

Best of both world really.

Re: Moving to zsh (2019)

#39
post #31

Earlier quoted context omitted.

I tried fish and really liked it until I tried to run one of my numerous helper scripts and was faced with syntax error; too lazy to update so many scripts.

Did you try "bash " or adding a #! line, which scripts should generally have anyway?

Not the op, but that only worked half of the time when running install scripts from the internet. To make it really work you basically had to setup and maintain a full bash environment in parallel to the fish environment (env variables, paths, etc...). Most software packages out there really expect that you're running in a bash-compatible environment.

Re: Moving to zsh (2019)

#40
post #31

Earlier quoted context omitted.

Did you try "bash " or adding a #! line, which scripts should generally have anyway?

Not the op, but that only worked half of the time when running install scripts from the internet. To make it really work you basically had to setup and maintain a full bash environment in parallel to the fish environment (env variables, paths, etc...). Most software packages out there really expect that you're running in a bash-compatible environment.

I launch a bash shell, which inherits parent fish shell's env, then run the command and exit back to fish.
Post reply on HN