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.)
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.)
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.
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.
i am using ZSH cause Fish is not POSIX compliant,which made it annoying to run scripts without rewriting them.
When is this a problem? What scripts don’t use a shebang and/or why does using
shcall 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.)
I think they don’t use shebang
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/shfrom a Fish shell, it won’t use Fish, it will use whatever you haveshpointing to. (Which shouldn’t be Fish, it’s usually bash or dash.)I ran into issues on fish,i don’t remember what they are but I think it’s no shebang
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.
#!/bin/sh
Hope this helps
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
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.