SC1065 – ShellCheck Wiki

See this page on GitHub

Sitemap


Trying to declare parameters? Don't. Use () and refer to params as $1, $2, ..

Problematic code:

foo(input) {
  echo "$input"
}
foo("hello world");

Correct code:

foo() {
  echo "$1"
}
foo "hello world"

Rationale:

Shell script functions behave just like scripts and other commands:

Exceptions:

None.


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