Fish the bash way | Farid Zakaria’s Blog

submited by
Style Pass
2024-07-18 07:30:12

The obvious downside to fish is that it is non-standard POSIX sh – meaning some (not all!) of the 1-line scripts you find on the Internet may not work.

In practice, it should not that bad since scripts can set a shebang like #! /usr/bin/env bash to make sure they are portable. In reality, I’ve been bit too much by tools that run commands without explicitly setting the shell and relying on my login $SHELL. 🙅‍♂️🤯

Create a bash function in fish that starts bash with the secret environment variable NO_FISH_BASH so that we don’t get into an endless loop.

Your $SHELL remains bash, which means that any non-interactive use by programs will get the common bash they unfortunately implicilty rely on.

Leave a Comment