Is this what you want?
Code:my_var="$( free -m | grep Mem: | busybox awk '{ print $4 " MB" }')"
Hello all,
I requried a spot of help. I need a bash script to read only the free RAM from the command free and store it in a variable. I know we need to use awk or gawk, but I'm unsure on the syntax.
This does'nt seem to be working on the E6:
Code:echo "$( free -mto | grep Mem: | busybox awk '{ print $4 " MB" }')"
Is this what you want?
Code:my_var="$( free -m | grep Mem: | busybox awk '{ print $4 " MB" }')"