Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

6
  • Note that /bin/sh doesn't identify a particular shell.  On some systems it points to bash (in a POSIX-compliant mode); on others it may be dash or even the original Bourne shell.  All you know is that it's POSIX-compliant; you can't tell what extra features it may support.  (Even in POSIX mode, bash supports lots of things that other shells don't.  — Which means that running on /bin/sh doesn't prove that your script is POSIX-compliant…  Dash is much more suited to that.) Commented Sep 11, 2025 at 23:23
  • Can you give an example where you need a fall-through? Commented Sep 12, 2025 at 7:22
  • Thank you for your question, I use bash since ... many decades and never saw the "&;" fallthrough facility in case Commented Sep 12, 2025 at 11:17
  • @U.Windl: Improved question to include the fallthrough's use. Dulac: am glad others found use for this. Commented Sep 12, 2025 at 18:29
  • The fact that you want this means your script is reaching the limit of what is reasonable to do in shell. If you have the option of using any shell extensions whatsoever, then you also have the option of writing your script in a language which isn't as limited as shell. You should consider that option before you go looking for anything that isn't obviously possible in portable shell. (I wrote more exposition on this point in these answers: unix.stackexchange.com/a/250935 and unix.stackexchange.com/a/129120 .) Commented Sep 13, 2025 at 14:12