Page 1 of 1

escaping quotes

Posted: Wed Oct 21, 1998 10:51 am
by Thunderstone


How do you escape quotes within double quoted strings?

I want the following result:
<!--#include virtual="public/head.htm"-->

using <send "<!--#include virtual="public/head.htm">

The quotes MUST be included within a double quoted string
literal since I have to use send within an <exec> to get our SSI
to function properly.




escaping quotes

Posted: Wed Oct 21, 1998 11:14 am
by Thunderstone



Same way as in HTML: use single quotes to enclose the string instead of
double quotes.


Use: <send '<!--#include virtual="public/head.htm">'>


I don't know what your overall goal is, but check to see if
it can be accomplished entirely withing the Vortex script, perhaps with
<spew> to send files or <fetch> for URLs. In general you should think
carefully before <EXEC>ing another program or using SSI, because these
incur additional overhead and parsing that may not be necessary.

-Kai



escaping quotes

Posted: Wed Sep 13, 2006 9:41 am
by hillman
Doesn't seem to work within a fmt or strfmt function?

<strfmt '<A HREF="$s">%s</A><br />' $URL $TITLE>

... produces:

Argument must be single variable or literal in the function: ()

I also tried:

<sum %s '<A HREF="' $URL '">' $TITLE '</A><br />'>

... and got:

Missing start double quotes in function: ()

escaping quotes

Posted: Wed Sep 13, 2006 9:53 am
by hillman
Sorry, my mistake! The first example does work, it's just I mixed a '$' for a '%' in the first %s.

escaping quotes

Posted: Wed Sep 13, 2006 9:53 am
by John
You want:

<strfmt '<A HREF="%s">%s</A><br />' $URL $TITLE>

To print the URL in the function with a fmt code.

To get a dollar sign in a string literal you need to double it up.