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;