• 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: Escape URL characters for shell
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Escape URL characters for shell


  • Subject: Re: Escape URL characters for shell
  • From: Matthew Leingang <email@hidden>
  • Date: Mon, 01 Mar 2004 12:01:44 -0500

Hey,

Sounds like you have to roll your own "quoted form of" operator that only
escapes slashes (caution: LTS ahead)?

set thisSongEsc to do shell script "echo '
& thisSong & "' | sed -e 's/\//\/\//g'

What else do you need to escape in a URL that gets dropped into a sed
expression?

--Matt

On 3/1/04 9:19 AM, "Gnarlodious" <email@hidden> wrote:

> Entity Walter Ian Kaye spoke thus:
>
>>> What's the easiest way to escape URL's before assembling a shell command?
>>> "quoted form of" seems like a good idea but doesn't do a thing for me. Is
>>> there another trick?
>>
>> Funny, it works fine for me...
>>
>> Any particular URL it's failing on?
> Example:
>
> set aURL to
> "http://www.allmusic.com/cg/amg.dll?p=amg&uid=UIDMISS70402281058012766&sql=A
> pe2m96ho3ep1"
>
> quoted form of aURL
>
> I'm sure I have seen this construct return an escaped URL, but not done like
> this.
>
> I'm saying this:
> do shell script "sed -e '/^<th/{N;s/\\(<th.*\\n<tr>\\)/\\1" & thisSong & "
> <tr>/;};P;D' " & filePathPOSIX
>
> where variable thisSong may contain a URL, but a URL contains "/".
>
> -- Gnarlie
> _______________________________________________
> 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.
>
>

--
Matthew Leingang
Preceptor in Mathematics, Harvard University
email@hidden
_______________________________________________
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.


References: 
 >Re: Escape URL characters for shell (From: Gnarlodious <email@hidden>)

  • Prev by Date: finding overset boxes in Quark 4.11
  • Next by Date: Re: Photoshop Script Tiff options help . . . please
  • Previous by thread: Re: Escape URL characters for shell
  • Next by thread: Re: Escape URL characters for shell
  • Index(es):
    • Date
    • Thread