Skip to content

Latest commit

 

History

History
23 lines (14 loc) · 438 Bytes

SC2037.md

File metadata and controls

23 lines (14 loc) · 438 Bytes

Pattern: Missing use of var=$(command)

Issue: -

Description

To assign the output of a command to a variable, use $(command substitution). Just typing a command after the = sign does not work.

Example of incorrect code:

var=grep -c pattern file

Example of correct code:

var=$(grep -c pattern file)

Further Reading