• 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
do shell script "perl... " to find/replace in a string
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

do shell script "perl... " to find/replace in a string


  • Subject: do shell script "perl... " to find/replace in a string
  • From: Joseph Weaks <email@hidden>
  • Date: Wed, 17 Mar 2004 00:26:15 -0600

I am at a loss when trying to figure out the syntax for perl/unix commands. Given three variables, what would be a one liner do shell script command that replaced every occurrence of findString in sourceText with replaceString? I'm looking for something like:

set shellCommand to "perl blah blah" & quoted form of sourceText & "blah blah" & quoted form of findString & "blah blah" & quoted form of replaceString & "blah blah blah"
set sourceText to do shell script shellCommand

Not sure perl is the correct unix command to use for this.
Secondly, is it possible to pass a unicode hex number as the replaceString?
What I'm working towards is a font conversion from a language font with stacking diacriticals to the unicode equivalent.

What would that shellCommand look like? I read through the archives, a see there is no way to specify a unicode character by it's hex, but I'm certain there is in a shell command. (I think it has to do with declaring standard output as unicode and then print chr (1FFF) or something?)

Thanks for any help,
Joe Weaks
_______________________________________________
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: do shell script "perl... " to find/replace in a string
      • From: Christopher Nebel <email@hidden>
    • Re: do shell script "perl... " to find/replace in a string
      • From: Gnarlodious <email@hidden>
  • Prev by Date: Re: AC power testing
  • Next by Date: Re: AC power testing
  • Previous by thread: Re: AC power testing
  • Next by thread: Re: do shell script "perl... " to find/replace in a string
  • Index(es):
    • Date
    • Thread