Skip to content

Files

Latest commit

 

History

History
23 lines (14 loc) · 481 Bytes

SC2060.md

File metadata and controls

23 lines (14 loc) · 481 Bytes

Pattern: Use of unquoted tr parameter

Issue: -

Description

[: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:]'

Further Reading