Comment by metax

2 days ago

Or simply use fish

Seriously. I do think people should spend enough time with bash or posix sh to be comfortable with it, but I'd recommend everyone at least just try fish. It's a lovely interactive experience out of the box with colors, completions, a great prompt, etc. Plus, the scripting language is quite comfy. Like, somewhere between bash and Python (if you find Python comfy, I guess). At least to me it makes more intuitive sense, once I got over the fact that "it's not bash/zsh."

It's written in Rust, if you care about that sort of thing (I switched before that was a thing). And for simple one-liners, compatibility actually has improved at least a bit (like you can do && now, which wasn't a thing before).

Write your shell-specific helper scripts or personal scripts in fish, write your portable scripts in Python or Bash. Look, I love standards. Sometimes non-standard things make sense though. Sometimes they even make more sense in the right context.

Or maybe you'll hate it. That's fine. People won't know until they try though.

For something newer and even more different, check out nushell. I don't have much experience with it, but a lot of its ideas are enticing.

Craziest thing: You can still script in bash/zsh even if you use fish but you can't always copy-paste from StackOverflow.

  • The problem is that I forgot (if I ever knew) bash.

    I can write fish, scripting or interactively on my shell without thinking too hard about the syntax, but when scripting in bash I require an example or using my snippets to be sure I'm not shooting myself on the foot or writing something that bash will reject right away.

    • The trick is to use "shellcheck" on your bash scripts, it's an overly anal linter that'll keep you sharp, and it's 2026, everyone can script bash with AI :)

      But yeah the syntax with [[, if fi, while stmt; do; done, "$@", case esac, "${!VAR}" and others makes me long for the day fish shell gets "euo pipefail" mode so I can stop writing bash or || true :)

      1 reply →

Glad to see fish getting some shout outs here. Been using it for over ten years now, and it is super easy to get going on new hosts - it is just one simple install away.

Yeap, each time I need a complex shell script, actually Python is a better chose. I just don't need a POSIX compliant shell

     /usr/bin/time -f "%e seconds" fish -i -c exit
     0.21 seconds

I've started to play with the idea more recently to try out fish. No appearant reason.. 10 years in zsh is time enough to get comfortable..