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.

2
  • 3
    Why are you recommending the least portable version? The POSIX variant without the word function would seem to be the canonical variant Commented Mar 7, 2022 at 13:08
  • 1
    How do you know they're running that with a Korn-compatible shell then? Also, the error message is exactly what Dash would give, and it only supports the POSIX-style function definition. function foo would be valid syntax in Dash, but it'd try to run a command called function. (Dash is /bin/sh in Debian and Ubuntu.) Commented Mar 7, 2022 at 13:35