Pattern: Use of unquoted tr
parameter
Issue: -
[:digit:]
is a shell glob that matches any single character file named e.g. g
or t
in the current directory. Quoting it prevents the script from breaking in directories with files like this.
Example of incorrect code:
tr -cd [:digit:]
Example of correct code:
tr -cd '[:digit:]'