Skip to content

Files

Latest commit

 

History

History
31 lines (18 loc) · 872 Bytes

SC1109.md

File metadata and controls

31 lines (18 loc) · 872 Bytes

Pattern: Use of escaped HTML entity

Issue: -

Description

There is an escaped HTML entity, such as &amp;, &gt; or &lt; (instead of &, > and <) in your code. This usually happens when copy-pasting from a web site that has mismanaged its code formatting.

You should go through the entire script and replace HTML entities with their corresponding characters.

Don't rely on ShellCheck to detect all of them. ShellCheck only warns about certain cases in certain contexts, while this issue tends to affect the entire script.

Example of incorrect code:

foo &amp;&amp; bar

Example of correct code:

foo && bar

Exceptions

If you want to run a command called amp after backgrounding another command, add a space: foo & amp;.

Further Reading