[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [cobalt-developers] raq4 memory problem...
- Subject: Re: [cobalt-developers] raq4 memory problem...
- From: "John P. Looney" <valen@xxxxxxxxxx>
- Date: Tue Aug 20 06:27:21 2002
- List-id: Discussion Forum for developers on Sun Cobalt Networks products <cobalt-developers.list.cobalt.com>
On Tue, Aug 20, 2002 at 08:26:59AM -0400, njd76 mentioned:
> How do you run this line
>
> echo $(( $physical - $used + $cache + $buffers - $swapused ))
>
> do you just do it at the command prompt?
No...just save the following out as a script, and run it:
#!/bin/sh
physical=`grep Mem: /proc/meminfo | awk '{print $2}'`
used=`grep Mem: /proc/meminfo | awk '{print $3}'`
buffers=`grep Mem: /proc/meminfo | awk '{print $6}'`
cache=`grep Mem: /proc/meminfo | awk '{print $7}'`
swapused=`grep Swap: /proc/meminfo | awk '{print $3}'`
echo $(( $physical - $used + $cache + $buffers - $swapused ))
The 'echo' should be the last line of the script, as it needs all the
variables to have been setup.
John