• Mwa@thelemmy.club
    link
    fedilink
    English
    arrow-up
    19
    ·
    edit-2
    2 days ago

    i am using ZSH cause Fish is not POSIX compliant,which made it annoying to run scripts without rewriting them.

    • JackbyDev@programming.dev
      link
      fedilink
      English
      arrow-up
      2
      ·
      9 hours ago

      When is this a problem? What scripts don’t use a shebang and/or why does using sh call fish instead of bash or dash?

      I have a mild dislike of fish because a few substitutions are different enough that my muscle memory isn’t there. (But I also haven’t put in serious effort to learn them.)

        • JackbyDev@programming.dev
          link
          fedilink
          English
          arrow-up
          1
          ·
          5 hours ago

          Have you run into a specific problem or is this just a hypothetical you’re worried about. I see this a lot but haven’t ever actually run into it being a concern. If you run a script with #!/bin/sh from a Fish shell, it won’t use Fish, it will use whatever you have sh pointing to. (Which shouldn’t be Fish, it’s usually bash or dash.)

          • Mwa@thelemmy.club
            link
            fedilink
            English
            arrow-up
            1
            ·
            3 hours ago

            I ran into issues on fish,i don’t remember what they are but I think it’s no shebang

            • JackbyDev@programming.dev
              link
              fedilink
              English
              arrow-up
              1
              ·
              45 minutes ago

              Ah, I see. If you don’t remember, don’t sweat. I’m mostly curious just because posix issues is one of the few complaints I hear but I never see anything specific so I’m extremely curious lol. Please don’t mistake this as one of those fanboyism moments where people try to say something they like is actually perfect and doesn’t have flaws.

              My understanding of shebangs is that it isn’t your shell doing anything fancy with it, it’s your OS (or something, I don’t remember exactly, but it’s lower level than the shell). So maybe something else borked. But I’m no fish expert, I have some error in some fish thing that prints an error every time I open a new shell that I’m too lazy to troubleshoot lol.

      • Mwa@thelemmy.club
        link
        fedilink
        English
        arrow-up
        5
        arrow-down
        1
        ·
        edit-2
        1 day ago

        how about if its not in a sh file,its common for scripts to use sh or bash instead. but am just gonna stick to ZSH anyways

        • Hawke@lemmy.world
          link
          fedilink
          arrow-up
          17
          ·
          1 day ago

          Linux doesn’t generally use extensions to decide what shell to use, so it doesn’t matter if it’s an sh file or not.

          If it uses bash of course you can substitute #!/bin/bash

          And of course you can use whatever shell you want, just saying that POSIX-compliance is not really relevant since the script can specify what shell it needs.