SC2118 – ShellCheck Wiki

See this page on GitHub

Sitemap


Ksh does not support |&. Use 2>&1 |

Problematic code:

#!/usr/bin/ksh
make |& tee ~/log

Correct code:

#!/usr/bin/ksh
make 2>&1 | tee ~/log

Rationale:

You are using the Bash specific shorthand |&, but your script is running with Ksh. Rewrite it to its full, POSIX-compatible form as shown in the example.

Exceptions:

None


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