Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
Hi Monks,
I want to extract the file name from the out put of ps -ef|grep java_app.
I am getting the below output which i have stored in $line variable.
$line = root 30145 1 0 Jan30 ? 00:09:01 /root/java/app/java_app_1Rule_ +java_app_2Rule.java --javaproc
Now i need to parse our "java_app_1Rule_java_app_2Rule"(name of the application).
I tried someting like my $id = $line =~m { /\/(.+)java/ }gx; but i am not getting any output.What am i missing here? Please help.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: extract file name from path
by RichardK (Parson) on Sep 11, 2013 at 17:23 UTC | |
Re: extract file name from path
by ww (Archbishop) on Sep 11, 2013 at 16:56 UTC | |
Re: extract file name from path
by hdb (Monsignor) on Sep 11, 2013 at 17:15 UTC | |
Re: extract file name from path
by Laurent_R (Canon) on Sep 11, 2013 at 16:52 UTC | |
by Anonymous Monk on Sep 11, 2013 at 17:00 UTC | |
by Laurent_R (Canon) on Sep 11, 2013 at 17:15 UTC | |
by Anonymous Monk on Sep 12, 2013 at 10:03 UTC | |
Re: extract file name from path
by keszler (Priest) on Sep 11, 2013 at 16:50 UTC | |
Re: extract file name from path
by TJPride (Pilgrim) on Sep 11, 2013 at 19:19 UTC | |
by Laurent_R (Canon) on Sep 12, 2013 at 07:52 UTC |
Back to
Seekers of Perl Wisdom