• 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: Native AS or grep via do shell script?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Native AS or grep via do shell script?


  • Subject: Re: Native AS or grep via do shell script?
  • From: Christopher Nebel <email@hidden>
  • Date: Thu, 28 Oct 2004 12:45:54 -0700

Well, "native" is putting it a bit strongly, but you can use any shell command -- grep, perl, whatever -- using the "do shell script" command from Standard Additions. See <http://developer.apple.com/technotes/tn2002/tn2065.html> for usage details. (It *doesn't* tell you anything about how to use the shell commands.)


--Chris Nebel AppleScript Engineering

On Oct 27, 2004, at 6:34 PM, Jeff Lambert wrote:

I'm only noticing this topic now, so, sorry for the intrusion but I'm VERY interested in using GREP in AS natively.

Chris, did I read you right? I can use call up Perl in AS? Does it come with the Developer kit or standard in OS 10.3 install? How do you call another scripting language in AS? I'm pretty new at all this, so if you have any links or info I can read on this, that'd be great.

TIA
--
Jeff
On 27-Oct-04, at 8:24 PM, email@hidden wrote:


Date: Wed, 27 Oct 2004 13:22:23 -0700
From: Christopher Nebel <email@hidden>
Subject: Re: Native AS or grep via do shell script?
To: AppleScript Users <email@hidden>
Message-ID: <email@hidden>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed


On Oct 27, 2004, at 3:00 AM, Jakob Peterhänsel wrote:

Now, if only the CLI grep was as flexible as the one in BBEdit... :-/

Try using egrep or grep -E -- that turns on the extended regular expression support. For instance, under egrep, your pattern could be equivalently written like this:

	[0-9]{2}-[0-9]{2}-[0-9]{4}

If you still feel deprived, you could use Perl instead, whose regular
expressions have all kinds of wacky features (not that you need most of
them here):


	perl -ne 'print if /\d{2}-\d{2}-\d{4}/'


--Chris Nebel AppleScript Engineering

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40apple.com


This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >Re: Native AS or grep via do shell script? (From: Jeff Lambert <email@hidden>)

  • Prev by Date: Re: Excel 2004 Scripting Block
  • Next by Date: Re: Native AS or grep via do shell script?
  • Previous by thread: Re: Native AS or grep via do shell script?
  • Next by thread: Re: Native AS or grep via do shell script?
  • Index(es):
    • Date
    • Thread