this post was submitted on 25 Jun 2026
94 points (99.0% liked)

Linux

14204 readers
726 users here now

A community for everything relating to the GNU/Linux operating system (except the memes!)

Also, check out:

Original icon base courtesy of lewing@isc.tamu.edu and The GIMP

founded 3 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
[–] trevor@lemmy.blahaj.zone 14 points 1 week ago* (last edited 1 week ago) (3 children)

Basically every non-Windows system comes with a POSIX-compliant shell at /bin/sh. If you're using shebangs in your POSIX shell scripts like you should, using Fish as your Friendly Interactive Shell shouldn't be a problem.

[–] arcine@jlai.lu 0 points 1 week ago (1 children)

Don't try to out-nerd me, your shebang advice isn't even POSIX compliant ! Use #!/usr/bin/env sh, there are systems (incl. NixOS) where there is no /bin/sh

And Fish's scripting language leaks into the interactive shell. Setting variables via export a=b doesn't work, for example. I don't like that.

[–] trevor@lemmy.blahaj.zone 2 points 1 week ago* (last edited 1 week ago)

Actually, /bin/sh is available on NixOS 🤓

Yes, it's true that #!/usr/bin/env bash is a more reliable way to get bash, but you mentioned that you wanted a POSIX shell, not that you specifically needed bash, so #!/bin/sh will work on any system including NixOS.

Also, export a=b does work in Fish. But you don't have to use it if you don't know how it works.

[–] tyler@programming.dev 0 points 1 week ago

even if it was... you can just run bash or /bin/sh and then run the script there. It's not you can't shell into a different shell to run a script. you lose nothing.