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.

1
  • actually, the first version makes no sense except to limit it as acceptable syntax to some shells. when you include the () and the function keyword the shell behaves as if you just did foo(){ ...; } anyway, except, of course, for a shell in which it is invalid syntax. and so you should do function foo { ...; } if you must, or foo(){ ...; } otherwise. Commented Dec 1, 2015 at 8:52