• 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: Nigel Smith <email@hidden>
  • Date: Thu, 22 Apr 2004 16:43:59 +0100

On 22/4/04 9:13, "Emmanuel" <email@hidden> wrote:

> At 4:56 PM -0400 21/04/04, Rebecca O'Connell wrote:
>> 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
> --------------------------

If Rebecca's example is really representative of what she wants, and not
just a much-simplified example, then wouldn't:

return myVar contains "a"

...be even simpler :-)

IIRC, the default case sensitivity changed at some point (AS v1.8?).
Shouldn't matter to Rebecca if she is considering shell scripts and
therefore has OSX, but the above would be even more portable as:

ignoring case
return myVar contains "a"
end ignoring

Later,

Nigel
_______________________________________________
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: Paul Berkowitz <email@hidden>
References: 
 >Re: How to use "do shell script" to search for RegExps (From: Emmanuel <email@hidden>)

  • Prev by Date: Re: Get iTune File Track by Alias
  • Next by Date: Re: Multi-line do shell script. How?
  • Previous by thread: Re: 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