Raoul has asked for the wisdom of the Perl Monks concerning the following question:
my $logname = `logname`; chomp($logname); my $output = `ps -ef | grep $logname`; if ($output =~ /.*\/export\/home\/$logname\/(.*)\/bin\/.*/m){ print "$`\n"; }
^.*\/export\/home\/$logname\/(.*)\/bin\/.*$
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Retrieve "ps -ef" strings using regex
by toolic (Bishop) on Aug 27, 2008 at 19:50 UTC | |
by Raoul (Initiate) on Aug 27, 2008 at 20:00 UTC | |
|
Re: Retrieve "ps -ef" strings using regex
by psini (Deacon) on Aug 27, 2008 at 19:42 UTC | |
by linuxer (Curate) on Aug 27, 2008 at 19:49 UTC | |
|
Re: Retrieve "ps -ef" strings using regex
by dwm042 (Priest) on Aug 27, 2008 at 20:11 UTC | |
by Raoul (Initiate) on Aug 27, 2008 at 20:14 UTC | |
|
Re: Retrieve "ps -ef" strings using regex
by betterworld (Curate) on Aug 27, 2008 at 21:33 UTC | |
by Raoul (Initiate) on Aug 28, 2008 at 18:22 UTC | |
|
Re: Retrieve "ps -ef" strings using regex
by linuxer (Curate) on Aug 27, 2008 at 19:44 UTC |