Low

Showing all detectors for the Shell language with low severity.

Invalid ShellCheck Directive Placement

ShellCheck directives incorrectly placed within case statement branches.

Unrecognized shebang

Unrecognized shebang, Tool supports only 'sh/bash/dash/ksh'. Add a 'shell' directive.

String Length Calculation

Use ${#variable} for efficient string length calculation.

Single quotes strictly terminate

In POSIX shell, single quotes strictly terminate quoted segments without interpreting any characters within.

Unnecessary Single Quotes

Use double quotes instead of single quotes for variable expansion in shell scripts.

Backslash followed by a linefeed

Single-quoted strings treat backslash followed by a linefeed as a literal backslash and linefeed, with no special meaning.

Use of terminate commands

Use either '&' or ';' to terminate commands, but not both.

Incorrect Tick Usage

Incorrect tick character usage.

Non Portable Character Class

Shell script uses non-portable character ranges instead of POSIX character classes for case conversion.

Missing Space Before Comment

Shell script contains a comment without a preceding space, potentially causing syntax errors.

Unnecessary Brackets In Tr

Shell script incorrectly uses square brackets around character ranges in tr command.

Unicode Quote Usage

Presence of Unicode quotes instead of ASCII quotes.

Integer Division Precision Loss

Shell script performs integer division before multiplication, potentially losing precision in calculations.

Unable To Follow Source

ShellCheck unable to analyze sourced file due to access issues or configuration.

Trailing Space After Backslash

Shell script contains trailing spaces after a backslash used for line continuation, causing syntax errors.

Incorrect Comment Syntax

Use correct comment syntax.

Unbraced Array Expansion

Shell script uses unbraced syntax for array expansion, potentially leading to incorrect interpretation.

Avoid Complex Logical Expressions

Don't use' A && B || C' as a substitute for if-then-else constructs.

Avoid escaping parentheses

Avoid escaping parentheses inside square bracket expressions.

Tr Misused For Word Replacement

Shell script incorrectly uses tr command to replace words instead of individual characters.

Bracket Spacing in Conditional Statements

Proper spacing before opening brackets in shell conditional statements.

Useless Cat Elimination

Avoid unnecessary use of 'cat' for single file input.

Unnecessary Dollar In For Loop

For loop in shell script incorrectly uses $ on the iterator variable name.

Dollar should be escaped with a backslash

In double quotes, $ is special but can be interpreted literally in specific contexts; use a backslash to escape it when intended as literal.

Only literals can be escaped

Incorrect escape sequences are ignored, use a literal backslash, single quote, or correct escape method.

Process only removes tabs

The process only removes tabs, not spaces, but your editor might convert tabs to spaces automatically.

Shell Prompt Escape Sequences

Shell prompt uses unescaped escape sequences, leading to display issues.

Echo Escape Sequences

Shell script uses echo to print escape sequences, which doesn't work as intended.

Escape Dollar Sign in Quotes

Use backslash to escape $ within quotes instead of ending quotes.

Unnecessary Backslash Escape

Avoid unnecessary backslash escapes.

Non Constant Source

Shell script uses a non-constant source path, which can't be statically analyzed for potential issues.

Tilde Expansion

Use '$HOME' instead of tilde in quotes.

Unnecessary Variable Expansion

Avoid unnecessary dollar signs in arithmetic expressions.

Unnecessary Echo Pipe

Piping to 'echo' command incorrectly.

Unescaped Variable

Shell script incorrectly uses unescaped quotes within a string, causing syntax errors.

Misplaced ShellCheck Directive

ShellCheck directives incorrectly placed after commands.

Regex Asterisk Misuse

Shell script misuses asterisk in regex, potentially leading to unintended matches.

Unnecessary Echo

Remove unnecessary 'echo' when outputting command results.

Unsupported Script Language

Identifying scripts written in languages not supported by ShellCheck.

Unused Variable Detection

Variable appears unused in the script.

Parameter Expansion for String Manipulation

Use parameter expansion instead of 'sed' for simple string replacements.