Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

True! lots of people sleeping on Fish. Probably because it's not POSIX compliant -- which is something I was hesitant about at first, too. My favorite features are: built-in vim mode, alt+s instead of sudo !!, backwards search with arrow-up, overall good default settings


Fish was weird at first, with it's insistence on `or` instead of `||`, and `and` instead of `&&`. Since they relented on this, there's not much non-POSIX weirdness for me. From time to time I'll try to `export` something, but fish just reminds you what to do instead. 3rd party integration is excellent now, too.

When I write scripts I'll just target /bin/sh, or /bin/bash if necessary. Never saw a reason to write zsh or fish scripts.


Note that `/bin/bash` isn't guaranteed to exist, even if Bash is installed. `/usr/bin/env` is guaranteed to exist on POSIX systems, so `/usr/bin/env bash` is the generally recommended way to invoke it in a shebang. `/bin/sh` is guaranteed to exist on a POSIX system, but `/usr/bin/env sh` can be used for consistency.


Export works now.

I write most of my local-use scripts in fish now. Having access to all the little ergonomics like outputting colored text is just more pleasant.


Note that `or/||` and `and/&&` are not interchangeable. They have different precedences.


100% this! I tried fish, loved it, then didn't use it for about a year becayse I'd convinced myself posix compliance was important. The truth is day to day I use 5 or less shell language primitives, mostly I run other programs from the shell, and pipe them into each other, so the shell language compliance doesn't matter.


I don't understand this reticence about POSIX compliance. When would you need your shell to be POSIX compliant? I've been using fish for ten years and I've never had an issue, even with scripting. If I need to run a script, it always has bash in the shebang line, so it runs normally.

Am I missing something useful?


Other people's scripts in projects where you can't or don't want to edit the scripts to add a shebang line.


You can only run those with `bash script` anyway, your shell doesn't matter in that case.


If you work with a lot of longer commands, you can press Alt+e to edit the current prompt in $EDITOR, so you can use your favorite editor to do whatever you'd like to the command.


I had no idea about that! You and other commenters taught me some great features! I so love fish!


Oh-my-zsh adds most of that while still being POSIX compliant


In my personal experience, oh-my-zsh slows down things too much. You're better off just taking whatever you really like about oh-my-zsh and configure it yourself.



"zsh is just fine, you just need to add a megabyte of scripts on top" is not a good advertisement :)


This whole time I didn't know you're supposed to use alt+s. I just got mad sudo !! didn't work. Thanks!




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: