File: linux_memory.pl

package info (click to toggle)
cacti 0.8.6i-3
  • links: PTS
  • area: main
  • in suites: etch-m68k
  • size: 4,744 kB
  • ctags: 8,967
  • sloc: php: 39,760; sql: 2,306; xml: 678; sh: 487; perl: 133; makefile: 68
file content (9 lines) | stat: -rw-r--r-- 174 bytes parent folder | download | duplicates (9)
1
2
3
4
5
6
7
8
9
#!/usr/bin/perl

open(PROCESS, "cat /proc/meminfo | grep -w $ARGV[0] |");
foreach (<PROCESS>) {
	if ($_ =~ /($ARGV[0].*\s)(.*[0-9])( kB)/) {
		print $2;
	}
}
close(PROCESS);