From 0c78750f61c619fd0eba1ea52d7111e58a97225b Mon Sep 17 00:00:00 2001 From: Doug MacEachern Date: Fri, 7 Oct 2005 23:53:00 +0000 Subject: [PATCH] make output same as sigar_proc_args.c --- exp/proc_args.pl | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/exp/proc_args.pl b/exp/proc_args.pl index 69d24ce1..5476180e 100644 --- a/exp/proc_args.pl +++ b/exp/proc_args.pl @@ -4,8 +4,9 @@ use strict; my $match = $ARGV[0]; -opendir DH, "/proc" or die; -chdir "/proc"; +my $proc = "/proc"; +opendir DH, $proc or die; +chdir $proc; local $/; while (my $pid = readdir DH) { @@ -16,7 +17,15 @@ while (my $pid = readdir DH) { if ($match) { next unless grep { /$match/o } @cmdline; } - print "(pid=$pid) ", (map { "=>$_<=" } @cmdline), "\n"; + + print "-------------------------------\n"; + + my $i=0; + print "pid=$pid\n"; + for my $arg (@cmdline) { + print "$i='$arg'\n"; + $i++; + } } closedir DH;