• 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: How to use "do shell script" to search for RegExps
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to use "do shell script" to search for RegExps


  • Subject: Re: How to use "do shell script" to search for RegExps
  • From: Emmanuel <email@hidden>
  • Date: Thu, 22 Apr 2004 10:13:36 +0200

At 4:56 PM -0400 21/04/04, Rebecca O'Connell wrote:
>I have read a number of thread where someone suggests using "do shell
>script" and perl to do a string search. Could someone post an example of the
>syntax one would use to do this? For example if wanted to do something
>equivalent to
>
>if myVar contains \(a|A)\ then set hasA to true
>
>using a shell script how would I go about it?

Not a reply to your question, but why not using AppleScript? It's more user-friendly, and the parameter passing mechanism is far more sophisticated and powerful than for shell scripts, isnt'it.

Using the Satimage osax:

--------------------------
set hasA to false
try
find text "a" in myVar without case sensitive
set hasA to true
end try
--------------------------

And, in case you're wondering, Satimage's 'find text' is as fast as, e.g., the 'grep' shell command.

Satimage.osax is free:
<http://www.satimage-software.com/en/downloads_osaxen.html>

Emmanuel
_______________________________________________
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: How to use "do shell script" to search for RegExps
      • From: Nigel Smith <email@hidden>
References: 
 >How to use "do shell script" to search for RegExps (From: "Rebecca O'Connell" <email@hidden>)

  • Prev by Date: Re: Multi-line do shell script. How?
  • Next by Date: Re: Changing Spelling Dictionary?
  • Previous by thread: How to use "do shell script" to search for RegExps
  • Next by thread: Re: How to use "do shell script" to search for RegExps
  • Index(es):
    • Date
    • Thread