Moving to zsh (2019)
scriptingosx.com
scriptingosx.com
[1] https://www.howtogeek.com/444596/how-to-change-the-default-s...
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.
https://github.com/zsh-users/zsh-autosuggestions
Best of both world really.
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
~ 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 $?
1But it's not. It's a bash built in pseudo file. So it should work in bash on other operating systems.
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.
What other cool use cases could it achieve besides checking if a domain is reachable?
We need a friendlier netcat, with better output. Call it netdog.
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.
Worst case, really, is that many of them do $PATH manipulation, set Env variables for you, or setup autocomplete and you'll need to redo that work in your shell of choice if it doesn't act like bash/zsh (e.g. I think nushell would be the most annoying in this way).
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?
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.
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?
Hardly insurmountable, but the change was a “forced” part of the upgrade.
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.