in reply to current RAM availability
You'll have to decide whether you want to include swap usage in it or not.
In linux, parse /proc/meminfo. In other unix systems, you might try to parse the output of free, or top bn1 if free doesn't work for some reason. (Update: it seems that free doesn't exist on solaris. top does work, but its arguments are different from the linux version.)
|
|---|