SC2217 – ShellCheck Wiki

See this page on GitHub

Sitemap


Redirecting to echo, a command that doesn't read stdin. Bad quoting or missing xargs?

Problematic code:

echo << eof
  Hello World
eof

Correct code:

cat << eof
  Hello World
eof

Rationale:

You are redirecting to one of several commands that don't read from stdin.

This may happen when:

Check your logic, and rewrite the command so data is passed correctly.

Exceptions:

If you've overridden a command to return output, you can either rename it to make this obvious, or ignore this message.


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