this post was submitted on 23 Jul 2026
510 points (95.2% liked)

linuxmemes

32204 readers
1148 users here now

Hint: :q!


Sister communities:


Community rules (click to expand)

1. Follow the site-wide rules

2. Be civil
  • Understand the difference between a joke and an insult.
  • Do not harrass or attack users for any reason. This includes using blanket terms, like "every user of thing".
  • Don't get baited into back-and-forth insults. We are not animals.
  • Leave remarks of "peasantry" to the PCMR community. If you dislike an OS/service/application, attack the thing you dislike, not the individuals who use it. Some people may not have a choice.
  • Bigotry of any kind will not be tolerated. This is an LGBTQ+-friendly community -- if that is a problem for you, you should leave.
  • 3. Post Linux-related content
  • Including Unix and BSD.
  • Non-Linux content is acceptable as long as it makes a reference to Linux. For example, the poorly made mockery of sudo in Windows.
  • No porn, no politics, no trolling or ragebaiting.
  • Don't come looking for advice, this is not the right community.
  • 4. No recent reposts
  • Everybody uses Arch btw, can't quit Vim, <loves / tolerates / hates> systemd, and wants to interject for a moment. You can stop now.
  • 5. ๐Ÿ‡ฌ๐Ÿ‡ง Language/ัะทั‹ะบ/Sprache
  • This is primarily an English-speaking community. ๐Ÿ‡ฌ๐Ÿ‡ง๐Ÿ‡ฆ๐Ÿ‡บ๐Ÿ‡บ๐Ÿ‡ธ
  • Comments written in other languages are allowed.
  • The substance of a post should be comprehensible for people who only speak English.
  • Titles and post bodies written in other languages will be allowed, but only as long as the above rule is observed.
  • 6. (NEW!) Regarding public figuresWe all have our opinions, and certain public figures can be divisive. Keep in mind that this is a community for memes and light-hearted fun, not for airing grievances or leveling accusations.
  • Keep discussions polite and free of disparagement.
  • We are never in possession of all of the facts. Defamatory comments will not be tolerated.
  • Discussions that get too heated will be locked and offending comments removed.
  • ย 

    Please report posts and comments that break these rules!


    Important: never execute code or follow advice that you don't understand or can't verify, especially here. The word of the day is credibility. This is a meme community -- even the most helpful comments might just be shitposts that can damage your system. Be aware, be smart, don't remove France.

    founded 3 years ago
    MODERATORS
     
    you are viewing a single comment's thread
    view the rest of the comments
    [โ€“] Mwa@thelemmy.club 21 points 2 days ago* (last edited 2 days ago) (2 children)

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

    [โ€“] JackbyDev@programming.dev 2 points 1 day ago (1 children)

    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.)

    [โ€“] Mwa@thelemmy.club 1 points 1 day ago (1 children)

    I think they don't use shebang

    [โ€“] JackbyDev@programming.dev 1 points 23 hours ago (1 children)

    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 1 points 21 hours ago (1 children)

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

    [โ€“] JackbyDev@programming.dev 1 points 19 hours 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.

    [โ€“] Hawke@lemmy.world 19 points 2 days ago (1 children)
    [โ€“] Mwa@thelemmy.club 5 points 2 days ago* (last edited 2 days ago) (2 children)

    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 20 points 2 days 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.

    [โ€“] trevor@lemmy.blahaj.zone 12 points 2 days ago

    The file extension doesn't matter much on Linux. If you've got a shebang at the top, the shell you're running from will invoke the correct shell according to the shebang.

    In some situations, you may want to use something like bash <your-script>, but that would only be when you've got a script that doesn't have a shebang, but not having one is bad practice and you really should be using them. Fish isn't the only non-POSIX shell you're going to encounter on a Linux system. Python, Perl, and probably some others will be there, and using a shebang ensures no shenanigans. So whether or not you use Fish, you should always use shebangs.