#!/usr/bin/perl my $pid = $$; open (T,"top -d 1 -p $pid b |" ) or die $!; $|=1; while(<T>){ $output = $_; $output =~ tr/\n//; #print $output; my @words=split(/\s+/,$output); print join "\n",@words,"**************\n"; # if($words[0] =~ /$pid/){print "$words[4]\n"} }
In reply to Re: help in opening file with pipe
by zentara
in thread help in opening file with pipe
by uva
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |