[Israel.pm] memory usage

Tal Kelrich tal at musicgenome.com
Tue Sep 5 22:42:08 PDT 2006


On Tue, 5 Sep 2006 20:34:17 +0300
Gaal Yahas <gaal at forum2.org> wrote:

> On Tue, Sep 05, 2006 at 08:01:11PM +0300, guy keren wrote:
> > by the way, i usually run the memory-checking externally, in a
> > seperate script that greps for something know to belong to the
> > program i want to test. i always did this for C/C++ programs, so i
> > had a unique name. with a perl script its a bit harder...
> 
> % perl -le '$0 = "[moose]"; sleep 60' & ps aux | grep moose
> [1] 27264
> roo      27264  0.0  0.4   4556  1280 pts/3    S    20:33   0:00
> [moose] roo      27266  0.0  0.2   3072   688 pts/3    S+   20:33
> 0:00 grep moose
> 

save yourself a line of output, use grep [m]oose
this way grep doesn't match itself (useful when doing shell scripts)

-- 
Tal Kelrich
PGP fingerprint: 3EDF FCC5 60BB 4729 AB2F  CAE6 FEC1 9AAC 12B9 AA69
Key Available at: http://www.hasturkun.com/pub.txt
----
Sure he's sharp as a razor ... he's a two-dimensional pinhead!
----
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://perl.org.il/pipermail/perl/attachments/20060906/b65f1a19/attachment.pgp 


More information about the Perl mailing list