Shell detectors

Showing all detectors for the Shell language.

Browse by tags
Browse all detectors by tags.
Browse by severity
Browse all detectors by severity.
Browse by category
Browse all detectors by category.

Browse all detectors

Avoid LS-Grep

Prefer globs or loops over ls-grep.

Sudo Redirect Misuse

Shell script incorrectly uses sudo with I/O redirection, which doesn't work as intended.

Incorrectly used escape sequences

The problem involves replacing literal '\t' with actual tab characters using the command $(printf '\t').

Expr Modernization

Replace 'expr' with modern shell constructs.

Unquoted Special Parameters

Use quoted special parameters to prevent word splitting and globbing.

Single-Iteration Loop

Ensure for loops iterate over multiple values.

Prefer Find Over LS

Use 'find' for file operations instead of 'ls'.

Avoid Complex Logical Expressions

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

Unquoted Array Expansion

Missing quotes around array expansion.

PS Grep Alternative

Use pgrep for process lookup.

Unquoted Find Patterns

Lack of quotes around pattern arguments in 'find' command.

Unnecessary Variable Expansion

Avoid unnecessary dollar signs in arithmetic expressions.

Use of if and then

The problem involves checking the exit code or output of a command in a shell script using different conditional constructs.

Read Lines with While Loop

Use while loop for line-by-line processing.

Incorrect Quoting in Trap Commands

Using single quotes instead of double quotes in trap commands to prevent premature expansion of variables and commands.

Command Substitution Syntax

Use '$(...)' instead of backticks for command substitution.