Hacker News new | ask | show | jobs
by hiepph 1020 days ago
I would say it has a "better" scripting languages syntax.

For example, compare this in zsh:

``` case $input in "foo") echo "Input is foo" ;; "bar") echo "Input is bar" ;; ) echo "Input does not match any case" ;; esac ```

with this in Fish shell:

``` switch $input case "foo" echo "Input is foo" case "bar" echo "Input is bar" case "" echo "Input does not match any case" end ```

And it was a really small example. Fish can do much more with "simpler" and not arcane syntax.

Fish also has `string` to work with string much much easier [0].

You miss `oh-my-zsh`? Fish has `oh-my-zsh` [1].

You miss integration with `fzf`? Fish also has it.

One caveat is Fish is not POSIX-compatible. But I don't find it a compelling reason to not using it.

Personally, I use Fish as my main shell. I do use zsh/Bash in my company though since they're more ubiquitous.

[0] https://fishshell.com/docs/current/cmds/string.html

[1] https://github.com/oh-my-fish/oh-my-fish

1 comments

Very helpful, thank you. Was not aware of most of these aspects. Definitely curious to try fish now. Thanks!