From: Chas. Owens [EMAIL PROTECTED]
On 10/3/07, Jonathan Lang [EMAIL PROTECTED] wrote:
snip
Chas shows one possibility. However, that approach generally involves
slurping the entire file into the perl script, applying the regex to
the whole thing, and then spitting the result out again.
On 10/8/07, Jenda Krynicky [EMAIL PROTECTED] wrote:
From: Chas. Owens [EMAIL PROTECTED]
On 10/3/07, Jonathan Lang [EMAIL PROTECTED] wrote:
snip
Chas shows one possibility. However, that approach generally involves
slurping the entire file into the perl script, applying the regex to
siegfried wrote:
?? wrote:
siegfried wrote:
I need to search large amounts of source code and grep is not doing the
job. The problem is that I keep matching stuff in the comments of the
C++/Java/Perl/Groovy/Javascript source code.
Can someone give me some hints on where I might start
siegfried wrote:
I need to search large amounts of source code and grep is not doing the
job.
The problem is that I keep matching stuff in the comments of the
C++/Java/Perl/Groovy/Javascript source code.
Can someone give me some hints on where I might start on rewriting grep
in
perl so that
siegfried wrote:
Thanks, but if I am piping from stdin to stdout I see two problems:
(1) how do I implement the -n flags that tell me the line number and
file name where the matches are
Well, as long as you're only piping one file at a time, the line
number part isn't a problem; but I see
I need to search large amounts of source code and grep is not doing the job.
The problem is that I keep matching stuff in the comments of the
C++/Java/Perl/Groovy/Javascript source code.
Can someone give me some hints on where I might start on rewriting grep in
perl so that it ignores the
by strange coincidence, i just picked up where i had left off reading
Minimal Perl by Tim Maher, which goes into some detail about
replacing grep (among other functionalities) with either perl
one-liners or scripts, depending on preference/need. this book may
well be worth your time and money.
On 10/3/07, siegfried [EMAIL PROTECTED] wrote:
I need to search large amounts of source code and grep is not doing the job.
The problem is that I keep matching stuff in the comments of the
C++/Java/Perl/Groovy/Javascript source code.
Can someone give me some hints on where I might start on
On 10/3/07, Jonathan Lang [EMAIL PROTECTED] wrote:
snip
Chas shows one possibility. However, that approach generally involves
slurping the entire file into the perl script, applying the regex to
the whole thing, and then spitting the result out again. From what I
understand, this generally
siegfried wrote:
I need to search large amounts of source code and grep is not doing the job.
The problem is that I keep matching stuff in the comments of the
C++/Java/Perl/Groovy/Javascript source code.
Can someone give me some hints on where I might start on rewriting grep in
perl so that
Bakken, Luke [EMAIL PROTECTED] writes:
Voila. That's most likely your problem - a mismatch between line endings
and Cygwin mount point type.
And in case you hadn't seen them before... there are at least a few
sets of unix tools for dos/windows. Cygwin maybe the best known but
I've used Uwin
Voila. That's most likely your problem - a mismatch between
line endings
and Cygwin mount point type.
And in case you hadn't seen them before... there are at least a few
sets of unix tools for dos/windows. Cygwin maybe the best known but
I've used Uwin myself for sometime and never
My man pages and info pages are not working well and I cannot figure out how
to make grep search for a certain pattern. I even tried egrep and fgrep. So
how do I reinvent grep with perl? Here is my attempt:
perl -n -e 'print $. $_ if /^ *END *$/' *.f
This works better than grep, except for
Siegfried Heintze wrote:
My man pages and info pages are not working well and I cannot figure out how
to make grep search for a certain pattern. I even tried egrep and fgrep. So
how do I reinvent grep with perl? Here is my attempt:
There's no need. When you do 'man whatever', you can hit '/', type
Siegfried Heintze wrote:
Andrew,
Thanks. When I hit n to go to the next page, it says No previous
regular expression (press RETURN). So I can only display the first page. I
have it expanded to the full screen but I still cannot see the portion of
the display that tells me how to use extended
Siegfried Heintze [EMAIL PROTECTED] writes:
My man pages and info pages are not working well and I cannot figure out how
to make grep search for a certain pattern. I even tried egrep and fgrep. So
how do I reinvent grep with perl? Here is my attempt:
perl -n -e 'print $. $_ if /^ *END
Siegfried Heintze [EMAIL PROTECTED] writes:
This works better than grep, except for the fact it does not print the file
name. How can I make perl print the file file name?
How is it better than grep?
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL
-Original Message-
From: news [mailto:[EMAIL PROTECTED] On Behalf Of Harry Putnam
Sent: Saturday, October 09, 2004 4:33 PM
To: [EMAIL PROTECTED]
Subject: Re: How to reinvent grep with perl?
Siegfried Heintze [EMAIL PROTECTED] writes:
My man pages and info pages are not working well and I cannot
Siegfried Heintze [EMAIL PROTECTED] writes:
This, works, but it sure is ugly. Is there not an easier way to do this with
perl?
perl -e'@ARGV = (-) unless @ARGV; while(@ARGV){ $ARGV= shift @ARGV;
if(!open(ARGV, $ARGV)){ warn Cannot open $ARGV: $!\n; next;} while
(ARGV){ print $ARGV:$.:$_\n
19 matches
Mail list logo