Re: script for $vm_stat

[email protected] (Gaurav Vaidya)
Newsgroups perl.macosx
Message-ID <[email protected]>
Hi pano.irk,

On Dec 5, 2008, at 3:40 PM, [email protected] wrote:
> $ vm_stat
> [snip]
>
> Like this:
> $perl script.pl
> Pages free:248491 Pages active: 345632 Pages inactive: 306207 Pages
> wired down:146885 "Translation faults": 598998500 Pages copy-on-write:
> 42312589 Pages zero filled: 64106 Pages reactivated:64106 Pageins:
> 243273 Pageouts: 84934 Object cache:15930737

You want:
	vm_stat | perl -ne 'print "$1:$2 " if(/^\s*(.+)\s*:\s*(\d+).*$/)'

Although I'm not very sure why :-)

cheers,
Gaurav
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.