Skip to content

Function definitions: Add syntax that works for POSIX compliant shells #72

@palash25

Description

@palash25

Ref: https://stackoverflow.com/questions/12468889/bash-script-error-function-not-found-why-would-this-appear

The syntax described in the guide should also be accompanied by this alternative so that beginners in bash don't face the error function not found like I did

#!/bin/bash
hello() {
   echo world!
}
hello

say() {
    echo $1
}
say "hello world!"

Let me know if you need a PR for this I would be happy to do it 😄

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions