Why & How fish does not support POSIX?

fish isn’t and never tried to be compatible with POSIX sh.

This really just means that it’s a separate language (like Java, Python or Ruby) rather than an implementation or extension of sh (like Bash, Dash and Ksh).

Obviously, just like you can’t copy-paste Java snippets into a Python program, you can’t copy-paste sh code into fish.

In practice, this means that when you search for things like “how do I show the current git branch in my prompt”, you need to make sure you find fish answers because the sh ones won’t work. Similarly, when books or instructions give commands to run, you may occasionally need to rewrite some of them manually (or open a bash shell and paste them there).

Whether this matters is entirely up to you, so definitely give it a go.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)