in reply to Re: Retrieve "ps -ef" strings using regex
in thread Retrieve "ps -ef" strings using regex
my $logname = `logname`; chomp($logname); my @output = `ps -ef | grep $logname`; foreach(@output) { chomp; next if /\~$/ || !$_; my $file = $_; if ($file =~ /^.*\/export\/home\/$logname\/(.*)\/bin\/.*?/) { print "$1\n"; } }
|
|---|