Well my first point would be that your cut commands don't actually return the right values (at least not for me). I am guessing that as the fields can
fluctuate in size this is not an accurate method. As the fields are white space delimited may I suggest you either use the -d and -f options in cut or
maybe try awk to retrieve the data:
Code:
vmstat | awk 'NR == 3{print $4 + $6}'
I would also suggest you have a look at the file /proc/meminfo as It contains a lot of well named and formatted data.
Lastly, as Chris pointed out, your exit command is incorrect, although it may just be a typo
