Hacker News new | ask | show | jobs
by ASTP001 2249 days ago
I really enjoyed using fish for a short while, but soon I learned that it was not POSIX compliant. This was a deal breaker for me since my colleagues would often share scripts that wouldn't just work for me. I use zsh nowadays.
2 comments

I love zsh, but it isn't without its own strange quirks that make compatibility exciting at times. In a thread from a fortnight ago¹, RANDOM is handled very differently for example. Try `echo $(echo $RANDOM) $(echo $RANDOM)` in zsh and bash.

I'm unsure whether minor differences that catch you out occasionally are worse than huge differences that you always have to think about. For me zsh still wins ;)

1. https://news.ycombinator.com/item?id=22841259

Wow! Even repeating that call always yields the same result in zsh - as long as it's a subshell.

I think your comment will save my sorry ass one day.

Well, you could always just use a shebang or call bash/sh directly on the file.
Without the same fluency in bashism from using it for day-to-day activities, the colleague provided script is less readable and less editable for the fish-fluent, bash-inarticulate. Any fish-specific scripts are also of low-value to colleagues.

It's not that it's impossible to be a shell polyglot, but GP deemed it easier to learn !fish.