SC2113 – ShellCheck Wiki

See this page on GitHub


function keyword is non-standard. Use foo() instead of function foo.

Problematic code:

function hello {
    echo "Hello World"

Correct code:

hello() {
    echo "Hello World"


function is a non-standard keyword that can be used to declare functions in Bash and Ksh.

In POSIX sh and dash, a function is defined without a function keyword. Instead, the function name is followed by () as in the correct example.



ShellCheck is a static analysis tool for shell scripts. This page is part of its documentation.