Live data from Hacker News

Moving to zsh (2019)

scriptingosx.com

41–45 of 45 posts

Re: Moving to zsh (2019)

#41
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?

All my scripts have "#!/usr/bin/env bash" at the top but in some cases that didn't help. Also, I think some bash specific bits in my .bashrc had syntax errors. Eventually I just didn't want to deal with the hassle of switching over.

Re: Moving to zsh (2019)

#42

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.

You're right, it does work on macOS.

What other cool use cases could it achieve besides checking if a domain is reachable?

Re: Moving to zsh (2019)

#43
post #26
post #12

Earlier quoted context omitted.

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.

nc generally provides more verbosity with -v and other options.

nc -v itself is pretty much telnet as far as TCP connections go (TELNET is itself another protocol on top of TCP).

In fact on macOS, I alias telnet=’nc -v’.

Anyway my intent wasn’t to directly challenge your method, this is just a more shell-independent and universal method of doing the same.

Re: Moving to zsh (2019)

#44

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".

That's a good idea, thank you! I simply installed zsh over the package manager, autocomplete seems to work other than rsync. I'll look into it when I get back to the computer and report back.
Post reply on HN