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"; } }
In reply to Re^2: Retrieve "ps -ef" strings using regex
by Raoul
in thread Retrieve "ps -ef" strings using regex
by Raoul
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |