Thank you so much Andreas and Grewin for quick help. :)
Gerwin Jansen
You're welcome ;)
I don't care about points but you should have selected the first comment as an (assisted) solution as well because that got you the mem/swap values into variables.
oram=/usr/bin/free -g | grep Mem | awk '{print $2}'
into
oram=$(/usr/bin/free -g | grep Mem | awk '{print $2}') and it should work
Same mod with the oswap line.