Re: Question about Sun JAVAC
From: Kai-Uwe Bux (jkherciueh_at_gmx.net)
Date: 08/30/04
- Next message: redguardtoo: "Work for a Chinese outsourcing company"
- Previous message: Paul Lutus: "Re: need advice on approach (was how to go about task)"
- In reply to: Edward G. Nilges: "Re: Question about Sun JAVAC"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Mon, 30 Aug 2004 02:09:28 -0400
Edward G. Nilges wrote:
> blmblm@myrealbox.com wrote in message
> news:<2pek8aFjidjhU1@uni-berlin.de>...
>> In article <f5dda427.0408282046.452b6e3d@posting.google.com>,
>> Edward G. Nilges <spinoza1111@yahoo.com> wrote:
>> >blmblm@myrealbox.com wrote in message
>> >news:<2pc6knFio079U1@uni-berlin.de>...
>> >> In article <f5dda427.0408271754.69403c35@posting.google.com>,
>> >> Edward G. Nilges <spinoza1111@yahoo.com> wrote:
>> >> [snip]
>> >> >Does linux in fact enable me to search my entire hard disk let us say
>> >> >for a files that contain foo OR are larger than 1M while containing
>> >> >boo?
>> >> >
>> >> >I'd say "without programming", but everything is "programming".
>> >> >Therefore can I enter a simple command
>> >> >
>> >> >findFile contains("foo") or size>1M and contains("boo")
>> >>
>> >> Well ....
>> >>
>> >> As you may remember, "grep" can identify files containing specified
>> >> text, and "find" can identify files over a particular size. I'm
>> >> pretty sure someone with more shell-using smarts than I have off the
>> >> top of my head could write a one-liner (or possibly a short script)
>> >> that would
>> >> accomplish your goal above. Of course it wouldn't be general, but the
>> >
>> >grep CANNOT to my knowledge READ the file.
>>
>> Read which file? If what you want to do is search for specified text
>> in a list of files, "grep" seems to me to be exactly the tool needed.
>> Some implementations even have a "--recursive" option that permits
>> searching a directory and all subdirectories.
>
> Yes, grep reads file contents. However, vanilla, "open" versions may
> have trouble with large ...
Finding a string within a file is linear in the length of the file unless
some indexing has been done beforehand. Until we have an indexing
filesystem that does this sort of preprocessing automatically, I would
presume that all versions (open and closed) of grep will take a long time
searching a complete hard drive.
> ... and with binary files, ...
If I want to avoid matches in binary files, I can use "grep -I"; and I am
using an "open" version of grep.
> ... and the objection remains that grep's notation is based on
> unreadable regular expressions.
Unreadable? If you are just searching for a string, the string itself will
be the regular expression you will want to use. What is unreadable about
that? Regular expression were designed so that you do not need messy stuff
for simple things. But I guess, what someone considers messy or simple is
more or less a cultural thing.
Best
Kai-Uwe Bux
- Next message: redguardtoo: "Work for a Chinese outsourcing company"
- Previous message: Paul Lutus: "Re: need advice on approach (was how to go about task)"
- In reply to: Edward G. Nilges: "Re: Question about Sun JAVAC"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|