Pattern: Missing use of var=$(command)
Issue: -
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)