Re: How to printout matching pattern in command line
- From: "Paul Lalli" <mritty@xxxxxxxxx>
- Date: 31 Mar 2006 10:17:52 -0800
pechoi@xxxxxxx wrote:
Hi all
I am trying to print out matching pattern at command line. How can I do
it?
my command looks like:
perl -e 'print m/PATTERN/g' filename
It's extranoridinarily difficult to know what you're asking. Could you
possible post some sample input and desired output?
I'm *guessing* that what you want to do is loop through all lines of
filename and print out any that match PATTERN. (Which, near as I can
tell, is just a simple Unix grep command). Is that correct?
perl -ne'print if /PATTERN/' filename
Read up on the -n command line option in: `perldoc perlrun`
Paul Lalli
.
- Follow-Ups:
- Re: How to printout matching pattern in command line
- From: pechoi
- Re: How to printout matching pattern in command line
- References:
- How to printout matching pattern in command line
- From: pechoi
- How to printout matching pattern in command line
- Prev by Date: Re: the only difference is the 'x' after '/g'
- Next by Date: Re: How to printout matching pattern in command line
- Previous by thread: How to printout matching pattern in command line
- Next by thread: Re: How to printout matching pattern in command line
- Index(es):
Relevant Pages
|
|