On 23 Oct 2000, Alan Shutko wrote:

>Date: 23 Oct 2000 09:20:28 -0400
>From: Alan Shutko <[EMAIL PROTECTED]>
>To: [EMAIL PROTECTED]
>Content-Type: text/plain; charset=us-ascii
>Subject: Re: basename in backticks
>
>John DeDourek <[EMAIL PROTECTED]> writes:
>
>> If I'm right, I might instead investigate whether
>> your /bin/basename is somehow messed up; or maybe you're right that
>> it is that find is somehow not executing /bin/basename correctly.
>
>It's find.  find /etc -exec sh -c 'echo {} `basename {}`' \; works as
>expected.

The above causes a fork(),exec() and load of /bin/sh with every
file found and is quite innefficient.

The following does the same, much quicker with a pipe.

find /etc | sed -e 's#.*/##g'



----------------------------------------------------------------------
      Mike A. Harris  -  Linux advocate  -  Open source advocate
              Computer Consultant - Capslock Consulting
                 Copyright 2000 all rights reserved
----------------------------------------------------------------------

[Quote: Linus Torvalds linux-2.4.0-test8-pre6 release message - Sept 6, 2000]
But I have this ugly feeling that I'm coming down with the same flu that
everybody else in my family had the last week, so I'd better release this
before I start puking on my keyboard.



_______________________________________________
Redhat-devel-list mailing list
[EMAIL PROTECTED]
https://listman.redhat.com/mailman/listinfo/redhat-devel-list

Reply via email to