fish, the friendly interactive shell, is a commandline shell intended to be interactive and user-friendly.

fish is intentionally not fully POSIX compliant, it aims at addressing POSIX inconsistencies (as perceived by the creators) with a simplified or a different syntax. This means that even simple POSIX compliant scripts may require some significant adaptation or even full rewriting to run with fish.

Source

  • Marafon@sh.itjust.works
    link
    fedilink
    arrow-up
    37
    ·
    19 days ago

    I just switched to fish for the pretty colors and quality of life features. Anything I should keep in mind while using it as a Linux noob? I don’t even know who POSIX is lol.

    • RmDebArc_5@piefed.zipOP
      link
      fedilink
      English
      arrow-up
      12
      ·
      19 days ago

      Okay so first there was Unix. It was semi Open Source and a bunch of companies were making different versions that were becoming increasingly incompatible. That is why POSIX was created, it standardizes major parts of Unix. Linux is a Unix like operating system, meaning it functions similarly but doesn’t share any code. One thing that POSIX standardizes is the shell meaning there’s a standard how a loop works etc. Most shell on Linux like bash and zsh are POSIX compliant but some (like fish aren’t). This means a command that works one way in bash might work differently in fish. Basic stuff is mostly the same in my experience so if you’re not having any problems you shouldn’t worry about being POSIX compliant. If you want most of the same stuff but POSIX compliant checkout zsh. Fish provides documentation for adjusting your commands so I’d just ignore it until you run into a problem and then take a look at the docks

    • JackbyDev@programming.dev
      link
      fedilink
      English
      arrow-up
      9
      ·
      19 days ago

      “POSIX compliant shells” means shells that work with… Fuck how do I even describe this simplistically? A lot of scripts are ran by a program named “sh”. Sometimes it is bash, sometimes dash, but they’re all POSIX compliant which means they’ve got some standard things that most people expect.

      Using a non POSIX compliant shells will be okay, because programs trying to use “sh” will still work (unless you set something up wrong, which you’d probably have to go out if your way to do, so you’re probably fine).

      Genuinely the only downside to using a non POSIX compliant shell is that you won’t learn the standard stuff so you won’t be as good at writing and reading scripts. It’s truly not too big of a deal. Fish (non POSIX compliant) is what Arch (or at least Cachy) used by default. It’s been great. The defaults are useful. To get a similar experience with POSIX shells I typically have to use zsh with oh-my-zsh and some plugins. Fish does it all out of the box.

      So don’t worry about it!

      • Marafon@sh.itjust.works
        link
        fedilink
        arrow-up
        2
        ·
        18 days ago

        Hell yeah, I don’t really mess with scripts much yet but I do love to be non standard. Thanks for the run down!

    • Nalivai@lemmy.world
      link
      fedilink
      arrow-up
      5
      ·
      18 days ago

      zsh with oh-my-zsh addon can do the same amount of pretty colours and qol stuff, with the addition of being POSIX compliant. Not that fish is bad or anything, but you don’t want additional troubles with random incompatibility on top of the usual learning curve.

    • thevoidzero@lemmy.world
      link
      fedilink
      arrow-up
      6
      arrow-down
      1
      ·
      edit-2
      18 days ago

      Then you’re just running bash scripts with bash. You’re not running bash scripts with fish.

        • bitwolf@sh.itjust.works
          link
          fedilink
          English
          arrow-up
          8
          ·
          edit-2
          18 days ago

          Exactly, use the shell you like (nushell in my case), write POSIX scripts for maintainability, and use shebangs so you don’t have to think about it.

          If you like fish but don’t use it as your login shell because it’s not POSIX you’re missing the point of the shebang

          • lilith267@lemmy.blahaj.zone
            link
            fedilink
            English
            arrow-up
            5
            ·
            17 days ago

            Write POSIX scripts for portability*, maintainability doesn’t depend much on the shell

            POSIX for the system, Fish for the interaction is how I like my OS :3

  • woelkchen@lemmy.world
    link
    fedilink
    arrow-up
    13
    ·
    19 days ago

    I really like Fish but for simple stuff like youtube-dl you always have to put quotation marks around the YouTube video’s address because Fish thinks the question mark is an operator. So annoying.

  • notarobot@lemmy.zip
    link
    fedilink
    arrow-up
    8
    arrow-down
    1
    ·
    edit-2
    19 days ago

    Non English speaker here . don’t you mean “non POSIX compliant” instead of “POSIX non compliant” ?or is it a hint at the fact that it is designed to actually be non compliant?

    • Capricorn_Geriatric@lemmy.world
      link
      fedilink
      arrow-up
      15
      arrow-down
      4
      ·
      edit-2
      19 days ago

      “non-POSIX compliant” = compliant with non-POSIX (whatever “non-POSIX” may be)

      “POSIX non-compliant” = not compliant with POSIX

      The best way to say what OP did would be a simple “not POSIX compliant”. Looking back, that’s exactly what was said in the post. The meme itself is, unfortunately a different story.

      Posix non-compliant was used in the meme because the author wanted to save on words in the puchline. “Using a shell not POSIX compliant” lacks a few words and is syntactically incorrect. “Using a POSIX non-compliant shell” saves on words, and is syntactically correct, but makes the sentence more complex.

      All in all, the “non-” prefix is a bit finicky in english and can usually be avoided.

      • four@lemmy.zip
        link
        fedilink
        English
        arrow-up
        15
        ·
        19 days ago

        Wouldn’t it be more like “non POSIX-compliant”? That’s how I would understand it, though I’m not a native speaker

        • Capricorn_Geriatric@lemmy.world
          link
          fedilink
          arrow-up
          4
          arrow-down
          1
          ·
          19 days ago

          Honestly, I didn’t see it that way. With the dash, I do. That works as well. It’s just that, if I put a dash somewhere myself, it’s the other way around.

    • Sidhean@piefed.social
      link
      fedilink
      English
      arrow-up
      6
      ·
      19 days ago

      Generally, people mix the two, so you have to use context. I think, however, your take is correct. I think the post is meant to give a bit of a rebellious vibe, so that may be why they chose this phrasing.

  • furry toaster@lemmy.blahaj.zone
    link
    fedilink
    English
    arrow-up
    5
    ·
    19 days ago

    Laughs in still needing to write POSIX scripts

    source, I use debian with fish and I write my scripts still in POSIX since fish is god slow at scripting, it is really nice for interactive usage but scripting performace is bad, and I can’t assume bash to be everywhere so POSIX I go

  • Gonzako@lemmy.world
    link
    fedilink
    arrow-up
    3
    ·
    18 days ago

    It’s installed on my machine but really don’t know how to make use of it that much. Any tips and tricksters?

    • Kurallier@programming.dev
      link
      fedilink
      arrow-up
      5
      ·
      edit-2
      18 days ago

      While using the fish shell you can just type ‘help’, and it’ll pull up an offline web page with their manuals and guides. But to be honest, I dont really use fish for anything but the fancy colors and auto-completion lol. Also fish 🐟 :)

  • CrazyLikeGollum@lemmy.world
    link
    fedilink
    English
    arrow-up
    1
    ·
    17 days ago

    Isn’t the list of shells that are “not fully POSIX compliant” basically every shell in modern use aside from sh?