Martin T writes:
>aren't you using grave accent("echo -e "\x60"") character? I was using
>"echo -e "\x27"" character.

Doh!  I read apostrophe (even named the script apos.slax) but my
brain turned into backtick.

Yes, this looks like a JUNOS bug:

root@box> op apos char "'"
''':(null):(2) Invalid expression
error: runtime error
error: Evaluating user parameter char failed

The underlaying slax library handles it correctly:

% slaxproc -E -n cs-examples/apos.slax -g -a char "'"
<?xml version="1.0"?>
<op-script-results>
  <output>got: '</output>
</op-script-results>

But it looks like this is explicitly handled in slaxproc.c:

            quote = strrchr(pvalue, '\"') ? '\'' : '\"';
            tvalue[0] = quote;
            memcpy(tvalue + 1, pvalue, plen);
            tvalue[plen + 1] = quote;
            tvalue[plen + 2] = '\0';

This logic doesn't appear in the JUNOS driver (/usr/libexec/ui/cscript).
I'll open a PR for this.

There is a limitation in XSLT that one can't mix strings with both
single and double quotes.  Strange but true.

Thanks,
 Phil
_______________________________________________
juniper-nsp mailing list juniper-nsp@puck.nether.net
https://puck.nether.net/mailman/listinfo/juniper-nsp

Reply via email to