Live data from Hacker News

Moving to zsh (2019)

scriptingosx.com

21–30 of 45 posts

Re: Moving to zsh (2019)

#21

I'm a zsh user, but one thing I miss from bash is /dev/tcp redirection. ~ echo /dev/tcp/google.com/80 ~ echo $? 0 ~ echo /dev/tcp/localhost/80 bash: connect: Network is unreachable bash: /dev/tcp/localhost/80: Network is unreachable ~ echo $? 1

Thanks. I've not seen that before, that's cool.

Re: Moving to zsh (2019)

#23

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

> Why is zsh forced on users anyway? Are there known issues with bash?

ZSH isn't GPL which may be important in the smaller non-Linux part of UNIX-like world. I would very much like to see ZSH in FreeBSD's base system already.

BTW, forced how?

Re: Moving to zsh (2019)

#24

I've been using bash since the early 90s and I'm now in my 40s so I think at this point I just have to accept that I will never use another shell. On Macs, the current version of bash can be installed from Homebrew and you can set it as your default shell in the SysPrefs, in Users > Right-click you > Advanced

This still presents an issue with shebang lines, though. I use ‘#!/usr/bin/env bash’ to work around this but occasionally have to modify other peoples scripts if they’re relying on newer bash features.

Re: Moving to zsh (2019)

#25

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

> Why is zsh forced on users anyway? Are there known issues with bash? ZSH isn't GPL which may be important in the smaller non-Linux part of UNIX-like world. I would very much like to see ZSH in FreeBSD's base system already. BTW, forced how?

There was a MacOS update that set everyone’s shell to zsh instead of the default (ancient) bash.

Hardly insurmountable, but the change was a “forced” part of the upgrade.

Re: Moving to zsh (2019)

#26
post #12

I'm a zsh user, but one thing I miss from bash is /dev/tcp redirection. ~ echo /dev/tcp/google.com/80 ~ echo $? 0 ~ echo /dev/tcp/localhost/80 bash: connect: Network is unreachable bash: /dev/tcp/localhost/80: Network is unreachable ~ echo $? 1

Why? There’s nc.

I tend to prefer telnet to test connections because its output is more verbose.

We need a friendlier netcat, with better output. Call it netdog.

Re: Moving to zsh (2019)

#27
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 way to make this work.

Does anyone know how to get it to work like in bash?

Re: Moving to zsh (2019)

#28

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.

Re: Moving to zsh (2019)

#29

Earlier quoted context omitted.

> Why is zsh forced on users anyway? Are there known issues with bash? ZSH isn't GPL which may be important in the smaller non-Linux part of UNIX-like world. I would very much like to see ZSH in FreeBSD's base system already. BTW, forced how?

There was a MacOS update that set everyone’s shell to zsh instead of the default (ancient) bash. Hardly insurmountable, but the change was a “forced” part of the upgrade.

Changing users' default shell is not the same as forcing it on users. You can chpass(1) and set a different shell.

I'm not too comfortable playing devil's advocate here as Apple really does force shitty changes on users. But this isn't one of those cases.

Re: Moving to zsh (2019)

#30

I'm a zsh user, but one thing I miss from bash is /dev/tcp redirection. ~ echo /dev/tcp/google.com/80 ~ echo $? 0 ~ echo /dev/tcp/localhost/80 bash: connect: Network is unreachable bash: /dev/tcp/localhost/80: Network is unreachable ~ echo $? 1

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.

Post reply on HN