no-backticks
What it does
Section titled “What it does”Reports a command substitution written with backticks.
Why it matters
Section titled “Why it matters”Backticks cannot be nested without escaping, treat backslashes inside in their own way, and are easy to mistake for a quote. $(...) nests, and the quoting inside it is the same as outside.
To fix, write $(...).
Example
Section titled “Example”now=`date`echo "`date +%s`" doneesc=`printf "\\n"`now=$(date)echo "$(date +%s)" doneesc=`printf "\\n"`Configuration
Section titled “Configuration”shell: lint: rules: no-backticks: warn # off (default), warn, errorEnabled by the presets: shell/shellcheck.
Suppress one line with sudsy-disable-next-line no-backticks in a comment of the file’s language.
Upstream equivalents
Section titled “Upstream equivalents”The same check in other tools; Sudsy reports what each upstream rule reports.
| Tool | Rule | Match |
|---|---|---|
| shellcheck | SC2006 |
full |