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
Prefer globs or loops over ls-grep.
Shell script incorrectly uses sudo with I/O redirection, which doesn't work as intended.
The problem involves replacing literal '\t' with actual tab characters using the command $(printf '\t').
Replace 'expr' with modern shell constructs.
Use quoted special parameters to prevent word splitting and globbing.
Ensure for loops iterate over multiple values.
Use 'find' for file operations instead of 'ls'.
Don't use' A && B || C' as a substitute for if-then-else constructs.
Missing quotes around array expansion.
Use pgrep for process lookup.
Lack of quotes around pattern arguments in 'find' command.
Avoid unnecessary dollar signs in arithmetic expressions.
The problem involves checking the exit code or output of a command in a shell script using different conditional constructs.
Use while loop for line-by-line processing.
Using single quotes instead of double quotes in trap commands to prevent premature expansion of variables and commands.
Use '$(...)' instead of backticks for command substitution.