• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag
 

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Two questions
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Two questions


  • Subject: Re: Two questions
  • From: bill <email@hidden>
  • Date: Wed, 10 Jul 2002 21:20:46 +0800

On 09/07/2002 03:23, "Christopher Nebel" <email@hidden> wrote:

> On Monday, July 8, 2002, at 08:50 AM, bill wrote:
>
>> Try this method:
>>
>> do shell script "find / | grep '.app$' > ~/Desktop/ListOfApplications"
>>
>> Briefly, use shell command find to list every items in root directory
>> recursively, grep item ends with '.app', send the output to a text file
>> named 'ListOfApplications' on your desktop.
>
> <Cough! Sputter!> That's a really horrible abuse of the the "find"
> command. "find" supports all sorts of interesting filters so it only
> returns the items you care about; making it return absolutely everything
> and then piping through "grep" is a waste of resources. Try this
> instead:
>
> find / -name "*.app"
>
> For me, it executes in about 2/3 the time. (Of course, "locate" is
> still the best, assuming you've got an up-to-date database.) For more
> details, read the "find" man page.
>
>
> --Chris Nebel
> AppleScript Engineering
>
>

Ahhhhhh! You catch me. :)

Well, "really horrible abuse", sounds serious. Chris, thanks for your
clarification. I9ll pay more attention to the options of each shell command.

By the way, find / -name "*.app" takes about 45 seconds, while using
3locate2, it9s less than one seconds on my machine.


Thanks
Bill
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.

References: 
 >Re: Two questions (From: Christopher Nebel <email@hidden>)

  • Prev by Date: RE: Quark syntax for creating a new paragraph with text
  • Next by Date: Re: uhoh
  • Previous by thread: Re: Two questions
  • Next by thread: Re: Two questions
  • Index(es):
    • Date
    • Thread