Re: Escape URL characters for shell
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.