• 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: Paul Skinner <email@hidden>
  • Date: Mon, 8 Jul 2002 16:24:46 -0400

So, how would one filter out returns like '/Applications/Internet/OmniWeb.app/Contents/'?

On Monday, July 8, 2002, at 03:23 PM, Christopher Nebel 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-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.

  • Follow-Ups:
    • Re: Two questions
      • From: Paul Skinner <email@hidden>
References: 
 >Re: Two questions (From: Christopher Nebel <email@hidden>)

  • Prev by Date: Re: Two questions
  • Next by Date: Re: how to use data from choose from list
  • Previous by thread: Re: Two questions
  • Next by thread: Re: Two questions
  • Index(es):
    • Date
    • Thread