Trying to run the following bash script. The output of the following ling fails:
mem = free | grep Mem | awk '{print $4/$2 * 100}'
With the error:
mem: command not found
Like this:
mem=$(free | grep Mem | awk '{print $4/$2 * 100}')
You can also use backticks:
mem=`free | grep Mem | awk '{print $4/$2 * 100}'`
But parentheses are preferred now. More: http://mywiki.wooledge.org/BashFAQ/082