then I can help with the regex ... more tips like this at How (Not) To Ask A Question, I know what I mean. Why don't you?, courtesy of PerlMonks FAQ, Tutorials#!/usr/bin/perl -T -- use strict; use warnings; use IPC::System::Simple qw' capturex '; Main( 'theuser' ); exit( 0 ); sub Main { my( $username ) = @_; #~ my $top = `top -b -n 1 -u $username`; ## Capture text while invoking the shell. #~ my $top = capturex( qw' top -b -n 1 -u ', $username ); my $output = <<'__TOP_EXAMPLE__'; here is something top will output it goes like this __TOP_EXAMPLE__ if( $output=~ /.../ ){ # my regex print "$1$2...\n"; } }
In reply to Re^6: Percent of CPU/Mem Usage for User
by Anonymous Monk
in thread Percent of CPU/Mem Usage for User
by geekt
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |