|
|
Log in / Subscribe / Register

Fish Shell 4 is written in Rust

Fish Shell 4 is written in Rust

Posted Feb 13, 2025 23:17 UTC (Thu) by intgr (subscriber, #39733)
In reply to: Fish Shell 4 is written in Rust by Nikratio
Parent article: Rewriting essential Linux packages in Rust

Fish is great as an interactive shell, but it's explicitly not POSIX compatible. It cannot run nontrivial shell scripts that work in most other shells. So not a replacement for /bin/sh.


to post comments

Fish Shell 4 is written in Rust

Posted Feb 15, 2025 6:25 UTC (Sat) by marcH (subscriber, #57642) [Link] (2 responses)

Many quick and dirty scripts start from my command line history. Conversely, I often copy/paste and "import" functions or other code from scripts to my command line for interactively using and/or testing it. This sort of interactive back and forth is too convenient, productive and important and I really don't want to lose it. So, "fish" is out.

Is zsh "compatible enough" with POSIX? Does not have to be 100% for the above. If not, is there some other, fancy new shell that is significantly better than bash and that I should try? I'd like not to lose too much readline "compatibility" either. readline key strokes are close to universal so why should I learn new, different ones? Except for new features of course. It's painful enough to switch between readline and vi commands already.

Fish Shell 4 is written in Rust

Posted Feb 15, 2025 23:33 UTC (Sat) by intgr (subscriber, #39733) [Link]

> zsh "compatible enough" with POSIX?

My understanding is yes, zsh is a proper POSIX shell and even implements some bashisms.

Fish Shell 4 is written in Rust

Posted Feb 17, 2025 13:50 UTC (Mon) by taladar (subscriber, #68407) [Link]

zsh can run pretty much any POSIX command unaltered but there are definitely some of the more advanced features in zsh interactive use you couldn't just copy into a bash script without modification (a lot of the globbing stuff comes to mind).

There are also some subtleties that make it unwise to test if a command in a bash script behaves exactly as desired in zsh instead of bash, particularly around sub shells and undefined variables.


Copyright © 2026, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds