facebook pixelShell Static Analysis Rules
BACK TO LIST

Shell rules

Bash, zsh, ksh: regardless what Shell you use, Codiga got you covered. With hundreds of rules, the Codiga Static Engine checks for any issue in your shell script and surfaces issues in your Shell codebase.

      1001

      Error prone
      Medium

      This \\N will be a regular 'N' in this context.

      1003

      Error prone
      Medium

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

      1004

      Error prone
      Medium

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

      1009

      Error prone
      Medium

      The mentioned syntax error was in this elif clause.

      1079

      Error prone
      Medium

      This is actually an end quote

      1091

      Error prone
      Medium

      Not following: /etc/os-release was not specified as input (see shellcheck -x).

      2009

      Error prone
      Medium

      Consider using pgrep instead of grepping ps output.

      2014

      Error prone
      Medium

      This will expand once before find runs

      Learn more

      2015

      Error prone
      Medium

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

      2017

      Error prone
      Medium

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

      2018

      Error prone
      Medium

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

      2019

      Error prone
      Medium

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

      2020

      Error prone
      Medium

      tr replaces sets of chars

      2021

      Error prone
      Medium

      Don't use [] around classes in tr

      2022

      Error prone
      Medium

      Note that unlike globs

      2023

      Error prone
      Medium

      The shell may override 'time' as seen in man time(1). Use 'command time ..' for that one.

      2026

      Error prone
      Medium

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

      2028

      Error prone
      Medium

      echo won't expand escape sequences. Consider printf.

      2029

      Error prone
      Medium

      Expansion on the client side

      2030

      Error prone
      Medium

      Modification of RSYSLOG\_VERSION is local (to subshell caused by pipeline).

      2031

      Error prone
      Medium

      RSYSLOG\_VERSION was modified in a subshell. That change might be lost.

      2032

      Error prone
      Medium

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

      2102

      Error prone
      Medium

      Ranges can only match single chars (mentioned due to duplicates).

      2166

      Error prone
      Medium

      Prefer [ p ] || [ q ] as [ p -o q ] is not well defined.

      2197

      Error prone
      Medium

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

      1112

      Error prone
      Medium

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

      2218

      Error prone
      Medium

      This function is only defined later. Move the definition up.

      2229

      Error prone
      Medium

      This does not read foo. Remove $/${} for that, or use ${var?} to quiet

      2065

      Error prone
      Medium

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