Assigning output from awk to variable
Use command substitution to assign the output of a command to a variable.
The syntax is: var1=$(command)
.
result=$(awk 'BEGIN{s=100} END {print s}' /dev/null)echo "The result is $result"
Use command substitution to assign the output of a command to a variable.
The syntax is: var1=$(command)
.
result=$(awk 'BEGIN{s=100} END {print s}' /dev/null)echo "The result is $result"