Rule Severity
SC1000  

$ is not used specially and should therefore be escaped.

Notice
SC1001  

This `\o` will be a regular 'o' in this context.

Notice
SC1003  

Want to escape a single quote? echo 'This is how it'\\''s done'.

Notice
SC1004  

This backslash+linefeed is literal. Break outside single quotes if you just want to break the line.

Notice
SC1007  

Remove space after = if trying to assign a value (or for empty string, use var='' ... ).

Notice
SC1009  

The mentioned parser error was in ...

Notice
SC1010  

Use semicolon or linefeed before 'done' (or quote to make it literal).

Notice
SC1011  

This apostrophe terminated the single quoted string!

Notice
SC1014  

Use 'if cmd; then ..' to check exit code, or 'if [\[ $(cmd) == .. ]]' to check output.

Notice
SC1015  

This is a unicode double quote. Delete and retype it.

Notice
SC1016  

This is a Unicode single quote. Delete and retype it.

Notice
SC1018  

This is a unicode non-breaking space. Delete it and retype as space.

Notice
SC1020  

You need a space before the if single then "]" else "]]"

Notice
SC1028  

In [..] you have to escape \\( \\) or preferably combine [..] expressions.

Notice
SC1029  

In `[[..]]` you shouldn't escape `(` or `)`.

Notice
SC1035  

You need a space here

Notice
SC1037  

Braces are required for positionals over 9, e.g. ${10}.

Notice
SC1038  

Shells are space sensitive. Use '< <(cmd)', not '<<(cmd)'.

Notice
SC1040  

When using <<-, you can only indent with tabs.

Notice
SC1041  

Found 'eof' further down, but not on a separate line.

Notice
SC1045  

It's not 'foo &; bar', just 'foo & bar'.

Notice
SC1046  

Couldn't find 'fi' for this 'if'

Notice
SC1048  

Can't have empty then clauses (use 'true' as a no-op).

Notice
SC1049  

Did you forget the 'then' for this 'if'?

Notice
SC1051  

Semicolons directly after 'then' are not allowed. Just remove it.

Notice
SC1052  

Semicolons directly after 'then' are not allowed. Just remove it.

Notice
SC1053  

Semicolons directly after 'else' are not allowed. Just remove it.

Notice
SC1054  

You need a space after the '{'.

Notice
SC1064  

Expected a { to open the function definition.

Notice
SC1065  

Trying to declare parameters? Don't. Use () and refer to params as $1, $2..

Notice
SC1066  

Don't use $ on the left side of assignments.

Notice
SC1068  

Don't put spaces around the = in assignments.

Notice
SC1071  

ShellCheck only supports sh/bash/dash/ksh scripts. Sorry!

Notice
SC1072  

Unexpected ..

Notice
SC1073  

Couldn't parse this ...

Notice
SC1075  

Use 'elif' instead of 'else if'.

Notice
SC1077  

For command expansion, the tick should slant left (` vs ´).

Notice
SC1078  

Did you forget to close this double quoted string?

Notice
SC1079  

This is actually an end quote, but due to next char it looks suspect.

Notice
SC1081  

Scripts are case sensitive. Use 'if', not 'If'.

Notice
SC1082  

This file has a UTF-8 BOM. Remove it with: LC_CTYPE=C sed '1s/^...//' < yourscript .

Notice
SC1083  

This `{`/`}` is literal. Check expression (missing `;/\n?`) or quote it.

Notice
SC1084  

Use #!, not !#, for the shebang.

Notice
SC1086  

Don't use $ on the iterator name in for loops.

Notice
SC1087  

Braces are required when expanding arrays, as in ${array[idx]}.

Notice
SC1088  

Parsing stopped here. Invalid use of parentheses?

Notice
SC1089  

Parsing stopped here. Is this keyword correctly matched up?

Notice
SC1090  

Can't follow non-constant source. Use a directive to specify location.

Notice
SC1091  

Not following: (error message here)

Notice
SC1094  

Parsing of sourced file failed. Ignoring it.

Notice
SC1095  

You need a space or linefeed between the function name and body.

Notice
SC1097  

Unexpected ==. For assignment, use =. For comparison, use [/[[.

Notice
SC1098  

Quote/escape special characters when using eval, e.g. eval "a=(b)".

Notice
SC1099  

You need a space before the #.

Notice
SC1100  

This is a unicode dash. Delete and retype as ASCII minus.

Notice
SC1101  

Delete trailing spaces after \ to break line (or use quotes for literal space).

Notice
SC1102  

Shells disambiguate $(( differently or not at all. If the first $( should start command substitution, add a space after it.

Notice
SC1104  

Use #!, not just !, for the shebang.

Notice
SC1105  

Shells disambiguate (( differently or not at all. If the first ( should start a subshell, add a space after it.

Notice
SC1107  

This directive is unknown. It will be ignored.

Notice
SC1108  

You need a space before and after the = .

Notice
SC1109  

This is an unquoted HTML entity. Replace with corresponding character.

Notice
SC1110  

This is a unicode quote. Delete and retype it (or quote to make literal).

Notice
SC1111  

This is a unicode quote. Delete and retype it (or ignore/singlequote for literal).

Notice
SC1112  

This is a unicode quote. Delete and retype it (or ignore/doublequote for literal).

Notice
SC1113  

Use #!, not just #, for the shebang.

Notice
SC1114  

Remove leading spaces before the shebang.

Notice
SC1115  

Remove spaces between # and ! in the shebang.

Notice
SC1116  

Missing $ on a $((..)) expression? (or use ( ( for arrays).

Notice
SC1117  

Backslash is literal in `"\n"`. Prefer explicit escaping: `"\\n"`.

Notice
SC1118  

Delete whitespace after the here-doc end token.

Notice
SC1119  

Add a linefeed between end token and terminating ')'.

Notice
SC1120  

No comments allowed after here-doc token. Comment the next line instead.

Notice
SC1121  

Add ;/& terminators (and other syntax) on the line with the <<, not here.

Notice
SC1122  

Nothing allowed after end token. To continue a command, put it on the line with the `<<`.

Notice
SC2001  

SC2001: See if you can use ${variable//search/replace} instead.

Notice
SC2002  

Useless cat. Consider 'cmd < file | ..' or 'cmd file | ..' instead.

Notice
SC2003  

expr is antiquated. Consider rewriting this using $((..)), ${} or [[ ]].

Notice
SC2004  

$/${} is unnecessary on arithmetic variables.

Notice
SC2005  

Problematic code:

Notice
SC2006  

Use $(STATEMENT) instead of legacy \`STATEMENT\`

Notice
SC2007  

Use $((..)) instead of deprecated $[..]

Notice
SC2008  

echo doesn't read from stdin, are you sure you should be piping to it?

Notice
SC2009  

SC2009 Consider using pgrep instead of grepping ps output.

Notice
SC2010  

Don't use ls | grep. Use a glob or a for loop with a condition to allow non-alphanumeric filenames.

Notice
SC2012  

Use find instead of ls to better handle non-alphanumeric filenames.

Notice
SC2013  

To read lines rather than words, pipe/redirect to a 'while read' loop.

Notice
SC2014  

This will expand once before find runs, not per file found.

Notice
SC2015  

Note that A && B || C is not if-then-else. C may run when A is true.

Notice
SC2016  

Expressions don't expand in single quotes, use double quotes for that.

Notice
SC2017  

Increase precision by replacing a/b\*c with a\*c/b.

Notice
SC2018  

Use '[:lower:]' to support accents and foreign alphabets.

Notice
SC2019  

Use '[:upper:]' to support accents and foreign alphabets.

Notice
SC2020  

tr replaces sets of chars, not words (mentioned due to duplicates).

Notice
SC2021  

Don't use [] around ranges in tr, it replaces literal square brackets.

Notice
SC2022  

Note that unlike globs, o* here matches 'ooo' but not 'oscar'

Notice
SC2024  

sudo doesn't affect redirects. Use ..| sudo tee file

Notice
SC2025  

Make sure all escape sequences are enclosed in \[..\] to prevent line wrapping issues

Notice
SC2026  

This word is outside of quotes. Did you intend to `'nest '"'single quotes'"'` instead'?

Notice
SC2027  

The surrounding quotes actually unquote this. Remove or escape them.

Notice
SC2028  

echo won't expand escape sequences. Consider printf.

Notice
SC2029  

Note that, unescaped, this expands on the client side.

Notice
SC2030  

Modification of var is local (to subshell caused by pipeline).

Notice
SC2031  

var was modified in a subshell. That change might be lost.

Notice
SC2032  

Use own script or sh -c '..' to run this from su.

Notice
SC2033  

Shell functions can't be passed to external commands.

Notice
SC2034  

foo appears unused. Verify it or export it.

Notice
SC2035  

Use ./\*glob* or -- \*glob* so names with dashes won't become options.

Notice
SC2036  

If you wanted to assign the output of the pipeline, use a=$(b | c) .

Notice
SC2037  

To assign the output of a command, use var=$(cmd) .

Notice
SC2038  

Use -print0/-0 or find -exec + to allow for non-alphanumeric filenames.

Notice
SC2039  

In POSIX sh, *something* is undefined.

Notice
SC2040  

#!/bin/sh was specified, so ____ is not supported, even when sh is actually bash.

Notice
SC2041  

This is a literal string. To run as a command, use $(..) instead of '..' .

Notice
SC2043  

This loop will only ever run once for a constant value. Did you perhaps mean to loop over dir/*, $var or $(cmd)?"

Notice
SC2044  

For loops over find output are fragile. Use find -exec or a while read loop.

Notice
SC2045  

Iterating over ls output is fragile. Use globs.

Notice
SC2046  

Quote this to prevent word splitting

Notice
SC2048  

Use "$@" (with quotes) to prevent whitespace problems.

Notice
SC2051  

Bash doesn't support variables in brace range expansions.

Notice
SC2053  

Quote the rhs of = in [[ ]] to prevent glob matching.

Notice
SC2054  

Use spaces, not commas, to separate array elements.

Notice
SC2055  

You probably wanted && here

Notice
SC2056  

You probably wanted && here

Notice
SC2059  

Don't use variables in the printf format string. Use printf "..%s.." "$foo".

Notice
SC2060  

Quote parameters to tr to prevent glob expansion.

Notice
SC2061  

Quote the parameter to -name so the shell won't interpret it.

Notice
SC2062  

Quote the grep pattern so the shell won't interpret it.

Notice
SC2063  

Grep uses regex, but this looks like a glob.

Notice
SC2064  

Use single quotes, otherwise this expands now rather than when signalled.

Notice
SC2065  

This is interpreted as a shell file redirection, not a comparison.

Notice
SC2066  

Since you double quoted this, it will not word split, and the loop will only run once.

Notice
SC2067  

Missing ';' or + terminating -exec. You can't use |/||/&&, and ';' has to be a separate, quoted argument.

Notice
SC2068  

Double quote array expansions to avoid re-splitting elements.

Notice
SC2069  

The order of the 2>&1 and the redirect matters. The 2>&1 has to be last.

Notice
SC2070  

-n doesn't work with unquoted arguments. Quote or use [\[ ]].

Notice
SC2071  

> is for string comparisons. Use -gt instead.

Notice
SC2072  

Decimals are not supported. Either use integers only, or use bc or awk to compare.

Notice
SC2074  

Can't use `=~` in `[ ]`. Use `[[..]]` instead.

Notice
SC2076  

Don't quote rhs of =~, it'll match literally rather than as a regex.

Notice
SC2077  

You need spaces around the comparison operator.

Notice
SC2078  

This expression is constant. Did you forget a `$` somewhere?

Notice
SC2081  

`[ .. ]` can't match globs. Use `[[ .. ]]` or grep.

Notice
SC2082  

To expand via indirection, use name="foo$n"; echo "${!name}".

Notice
SC2084  

Remove '$' or use '_=$((expr))' to avoid executing output.

Notice
SC2086  

Double quote to prevent globbing and word splitting.

Notice
SC2087  

Quote 'EOF' to make here document expansions happen on the server side rather than on the client.

Notice
SC2088  

Tilde does not expand in quotes. Use $HOME.

Notice
SC2089  

Quotes/backslashes will be treated literally. Use an array.

Notice
SC2090  

Quotes/backslashes in this variable will not be respected.

Notice
SC2091  

Remove surrounding $() to avoid executing output.

Notice
SC2092  

Remove backticks to avoid executing output.

Notice
SC2094  

SC2094 Make sure not to read and write the same file in the same pipeline.

Notice
SC2095  

Add < /dev/null to prevent ssh from swallowing stdin.

Notice
SC2096  

On most OS, shebangs can only specify a single parameter.

Notice
SC2097  

This assignment is only seen by the forked process.

Notice
SC2098  

This expansion will not see the mentioned assignment.

Notice
SC2101  

Named class needs outer [], e.g. [[:digit:]\].

Notice
SC2103  

Use a ( subshell ) to avoid having to cd back.

Notice
SC2105  

`break` is only valid in loops

Notice
SC2107  

Instead of [ a && b ], use [ a ] && [ b ].

Notice
SC2108  

In [\[..]], use && instead of -a.

Notice
SC2109  

Instead of [ a || b ], use [ a ] || [ b ].

Notice
SC2110  

In [\[..]], use || instead of -o.

Notice
SC2112  

'function' keyword is non-standard. Delete it.

Notice
SC2114  

Warning: deletes a system directory.

Notice
SC2115  

Use "${var:?}" to ensure this never expands to /* .

Notice
SC2116  

SC2116 Useless echo? Instead of 'cmd $(echo foo)', just use 'cmd foo'.

Notice
SC2117  

To run commands as another user, use su -c or sudo.

Notice
SC2119  

Use foo "$@" if function's $1 should mean script's $1.

Notice
SC2120  

foo references arguments, but none are ever passed.

Notice
SC2121  

To assign a variable, use just 'var=value', no 'set ..'.

Notice
SC2122  

>= is not a valid operator. Use '! a < b' instead.

Notice
SC2123  

PATH is the shell search path. Use another name.

Notice
SC2124  

Assigning an array to a string! Assign as array, or use * instead of @ to concatenate.

Notice
SC2125  

Brace expansions and globs are literal in assignments. Quote it or use an array.

Notice
SC2126  

Consider using grep -c instead of grep|wc.

Notice
SC2128  

Expanding an array without an index only gives the first element.

Notice
SC2129  

Consider using { cmd1; cmd2; } >> file instead of individual redirects.

Notice
SC2130  

-eq is for integer comparisons. Use = instead.

Notice
SC2139  

This expands when defined, not when used. Consider escaping.

Notice
SC2140  

Word is on the form "A"B"C" (B indicated). Did you mean "ABC" or "A\"B\"C"?

Notice
SC2141  

Did you mean IFS=$'\t' ?

Notice
SC2142  

Aliases can't use positional parameters. Use a function.

Notice
SC2143  

Use grep -q instead of comparing output with [ -n .. ].

Notice
SC2144  

-e doesn't work with globs. Use a for loop.

Notice
SC2145  

Argument mixes string and array. Use * or separate argument.

Notice
SC2146  

This action ignores everything before the -o. Use \\( \\) to group.

Notice
SC2147  

Literal tilde in PATH works poorly across programs.

Notice
SC2148  

Tips depend on target shell and yours is unknown. Add a shebang.

Notice
SC2149  

Remove $/${} for numeric index, or escape it for string.

Notice
SC2150  

-exec does not automatically invoke a shell. Use -exec sh -c .. for that.

Notice
SC2151  

Only one integer 0-255 can be returned. Use stdout for other data.

Notice
SC2152  

Can only return 0-255. Other data should be written to stdout.

Notice
SC2153  

Possible Misspelling: MYVARIABLE may not be assigned, but MY_VARIABLE is.

Notice
SC2154  

var is referenced but not assigned.

Notice
SC2155  

Declare and assign separately to avoid masking return values.

Notice
SC2156  

Injecting filenames is fragile and insecure. Use parameters.

Notice
SC2157  

Argument to implicit -n is always true due to literal strings.

Notice
SC2158  

[ false ] is true. Remove the brackets

Notice
SC2159  

[ 0 ] is true. Use 'false' instead

Notice
SC2160  

Instead of '[ true ]', just use 'true'.

Notice
SC2161  

Instead of '[ 1 ]', use 'true'.

Notice
SC2162  

read without -r mangle backslashes

Notice
SC2163  

Exporting an expansion rather than a variable.

Notice
SC2164  

Use cd ... || exit in case cd fails.

Notice
SC2165  

This nested loop overrides the index variable of its parent.

Notice
SC2166  

Prefer [ p ] && [ q ] as [ p -a q ] is not well defined.

Notice
SC2167  

This parent loop has its index variable overridden.

Notice
SC2168  

'local' is only valid in functions.

Notice
SC2169  

In dash, [\[ ]] is not supported.

Notice
SC2170  

Numerical -eq does not dereference in [..]. Expand or use string operator.

Notice
SC2172  

Trapping signals by number is not well defined. Prefer signal names.

Notice
SC2173  

SIGKILL/SIGSTOP can not be trapped.

Notice
SC2174  

When used with -p, -m only applies to the deepest directory.

Notice
SC2175  

Quote this invalid brace expansion since it should be passed literally to eval

Notice
SC2176  

'time' is undefined for pipelines. time single stage or bash -c instead.

Notice
SC2177  

'time' is undefined for compound commands, time sh -c instead.

Notice
SC2178  

Variable was used as an array but is now assigned a string.

Notice
SC2179  

Use array+=("item") to append items to an array.

Notice
SC2180  

Bash does not support multidimensional arrays. Use 1D or associative arrays.

Notice
SC2181  

Check exit code directly with e.g. 'if mycmd;', not indirectly with $?.

Notice
SC2182  

This printf format string has no variables. Other arguments are ignored.

Notice
SC2183  

This format string has 2 variables, but is passed 1 arguments.

Notice
SC2184  

Quote arguments to unset so they're not glob expanded.

Notice
SC2185  

Some finds don't have a default path. Specify '.' explicitly.

Notice
SC2186  

tempfile is deprecated. Use mktemp instead.

Notice
SC2187  

Ash scripts will be checked as Dash. Add '# shellcheck shell=dash' to silence.

Notice
SC2188  

This redirection doesn't have a command. Move to its command (or use 'true' as no-op).

Notice
SC2189  

You can't have | between this redirection and the command it should apply to.

Notice
SC2190  

Elements in associative arrays need index, e.g. array=( [index]=value ) .

Notice
SC2191  

The = here is literal. To assign by index, use ( [index]=value ) with no spaces. To keep as literal, quote it.

Notice
SC2192  

This array element has no value. Remove spaces after = or use "" for empty string.

Notice
SC2193  

The arguments to this comparison can never be equal. Make sure your syntax is correct.

Notice
SC2194  

This word is constant. Did you forget the $ on a variable?

Notice
SC2195  

This pattern will never match the case statement's word. Double check them.

Notice
SC2196  

egrep is non-standard and deprecated. Use grep -E instead.

Notice
SC2197  

fgrep is non-standard and deprecated. Use grep -F instead.

Notice
SC2198  

Arrays don't work as operands in [ ]. Use a loop (or concatenate with * instead of @).

Notice
SC2199  

Arrays implicitly concatenate in `[[ ]]`. Use a loop (or explicit * instead of @).

Notice
SC2200  

Brace expansions don't work as operands in [ ]. Use a loop.

Notice
SC2201  

Brace expansion doesn't happen in `[[ ]]`. Use a loop.

Notice
SC2202  

Globs don't work as operands in [ ]. Use a loop.

Notice
SC2203  

Globs are ignored in `[[ ]]` except right of =/!=. Use a loop.

Notice
SC2204  

(..) is a subshell. Did you mean [ .. ], a test expression?

Notice
SC2205  

(..) is a subshell. Did you mean [ .. ], a test expression?

Notice
SC2206  

Quote to prevent word splitting, or split robustly with mapfile or read -a.

Notice
SC2207  

Prefer mapfile or read -a to split command output (or quote to avoid splitting).

Notice
SC2208  

Use `[[ ]]` or quote arguments to -v to avoid glob expansion.

Notice
SC2209  

Use var=$(command) to assign output (or quote to assign string).

Notice
SC2210  

This is a file redirection. Was it supposed to be a comparison or fd operation?

Notice
SC2211  

This is a glob used as a command name. Was it supposed to be in ${..}, array, or is it missing quoting?

Notice
SC2212  

Use 'false' instead of empty [/[[ conditionals.

Notice
SC2213  

getopts specified -n, but it's not handled by this 'case'.

Notice
SC2214  

This case is not specified by getopts.

Notice
SC2215  

This flag is used as a command name. Bad line break or missing `[ .. ]`?

Notice
SC2216  

Piping to 'rm', a command that doesn't read stdin. Wrong command or missing xargs?

Notice
SC2217  

Redirecting to 'echo', a command that doesn't read stdin. Bad quoting or missing xargs?

Notice