HomeFreeBSD

SC2006: Use $(..) instead of legacy `..`.

Description

SC2006: Use $(..) instead of legacy ...

Backtick command substitution STATEMENT is legacy syntax with several
issues.

  • It has a series of undefined behaviors related to quoting in POSIX.
  • It imposes a custom escaping mode with surprising results.
  • It's exceptionally hard to nest.

$(STATEMENT) command substitution has none of these problems, and is
therefore strongly encouraged.

PR: 227109
Submitted by: mat
Sponsored by: Absolight

Details

Provenance
matAuthored on
Parents
rP471273: SC2155: Declare and assign separately to avoid masking return values.
Branches
Unknown
Tags
Unknown