logoalt Hacker News

ratorxlast Saturday at 10:11 AM1 replyview on HN

For POSIX: I leave Bash as the system shell and then shim into Fish only for interactive terminals. This works surprisingly well, and any POSIX env initialisation will be inherited. I very rarely need to do something complicated enough in the REPL of the terminal and can start a subshell if needed.

Fish is nicer to script in by far, and you can keep those isolated with shebang lines and still run Bash scripts (with a proper shebang line). The only thing that’s tricky is `source` and equivalents, but I don’t think I’ve ever needed this in my main shell and not a throw-away sub shell.


Replies

hiqlast Saturday at 11:10 AM

I often write multi-line commands in my zsh shell, like while-loops. The nice thing is that I can readily put them in a script if needed.

I guess that somewhat breaks with fish: either you use bash -c '...' from the start, or you adopt the fish syntax, which means you need to convert again when you switch to a (bash) script.

show 1 reply