I have a script whose contents are as below:
result= awk 's=100 END {print s }'
echo "The result is" $result
The desired output is:
The result is 100
My script is running without exiting and I am also not getting the desired output. Please help.
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"