Re: "Quoted form" puzzlement
Re: "Quoted form" puzzlement
- Subject: Re: "Quoted form" puzzlement
- From: "Mark J. Reed" <email@hidden>
- Date: Wed, 10 Nov 2010 14:12:46 -0500
What Yvan said.
In the shell, the way to get a literal string with no interpolation
whatsoever is to use single quotes.
'....'
Nothing is done to the stuff between single quotes. No variable
expansion, no backslash processing, nothing. Absolutely, 100% literal
data.
The problem is, that means there's no way to put a single quote inside
a single-quoted string.
But the thing about the shell that helps here is that you can put
different strings right next to each other and they're treated as one
big string instead of separate tokens.
So "foo"'bar'baz is exactly the same as "foobarbaz" or 'foobarbaz'
or, since there are no funky characters, the unquoted word foobarbaz.
Applescript's "quoted form of" takes advantage of this feature to get
literal apostrophes into a string. The string "Don't" becomes the
sequence 'Don'\''t': the single-quoted string 'Don', followed by the
unquoted string \' which turns into a literal apostrophe, followed by
the single-quoted string 't'.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden