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*

4
  • The error message is pretty self-explanatory: the ( shouldn't be there on line 2. Commented Feb 26, 2018 at 19:31
  • 3
    How do you call this script? Commented Feb 26, 2018 at 19:34
  • 1
    @tomasz has hit it right on the nose. The script is being executed by sh, not bash, and is choking on the function declaration syntax. Commented Feb 26, 2018 at 19:38
  • 1
    Related: difference between "function foo() {}" and "foo() {}" Commented Feb 26, 2018 at 20:53