[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: OT: Bash Scripting Question



On Sun, 2005-04-10 at 05:59 -0700, Steve Lamb wrote:
> Ron Johnson wrote:
> > Your next paragraph contradicts this sentence.
> 
>     It doesn't.
> 
> > And the GNU coreutils maintainers make you do things the way they
> > think things should be done.
> 
>     Nope.  Several examples were provided, not just one.  Also one explination
> was provided which explains why find is used.  You are finding these files.
> The thing is you're using an overly broad statement which happens to include
> all the files in a given path.  You'll note, however, that find does not
> replicate the functionality of ls.  It does not list all the file's attributes
> (name, date, mtime, permissions, size and so on) only the filename itself for
> another tool... say... ls to use to obtain that information.

Hmmm.  
  for f in $(ls -1)
  do
      blah ${f}
  done


It's not exactly like find(1), and it's not as efficient, but it's
Close Enough.

The point is is that these are the tools given to us by coreutils.
I.e., they are what the GNU coreutils maintainers have decided to
give to us.

Just like what you said other OS writers do to it's users.

> > Unless, as with every OS, you write your own utility.
> 
>     Incorrect.  I charge you to attempt to write a basic find utility which
> does the requested action in Win95, 98, NT, 2k, without using the provided
> utility (LOCATE, I believe) and without using a third party solution for any
> step.  Batch, AFAIK, is not up to the task.  :P

3rd party utility.  How broadly do you define that?  C/C++, or the
Windows ports of, for example, Python or Perl?

>     Finally I am wondering why you're railing against GNU core tools when they
> are just a replication and extension of the older unix core tools.  I've
> certainly used find on non-GNU systems.

I'm not *railing* against them.

I'm saying that "pass a list of file names to some external app"
should be given some other name besides "find".

"find" is a very broad word that means "search for".

Now is that "search for" a file (as ls also does), or "search for"
something inside a file?

But then, complaints that Unix utility names are cryptic is nothing
new.

-- 
-----------------------------------------------------------------
Ron Johnson, Jr.
Jefferson, LA USA
PGP Key ID 8834C06B I prefer encrypted mail.

"War is an ugly thing, but not the ugliest of things. The decayed
and degraded state of moral and patriotic feeling which thinks
that nothing is worth war is much worse. The person who has
nothing for which he is willing to fight, nothing which is more
important than his own personal safety, is a miserable creature,
and has no chance of being free unless made or kept so by the
exertions of better men than himself."
John Stuart Mill

Attachment: signature.asc
Description: This is a digitally signed message part


Reply to: