[j-nsp] Is it possible to pass apostrophe character(ASCII dec code 39) as an argument value to SLAX script?

Martin T m4rtntns at gmail.com
Thu Jul 12 04:00:12 EDT 2018


Hi!

Is it possible to pass apostrophe character(ASCII dec code 39) as an
argument value to SLAX script? I have tried to escape it, but it does
not seem to work:

root at vmx1> op test chr '
''':(null):(2) Invalid expression
error: runtime error
error: Evaluating user parameter chr failed

root at vmx1> op test chr "'"
''':(null):(2) Invalid expression
error: runtime error
error: Evaluating user parameter chr failed

root at vmx1> op test chr \'
'\'':(null):(3) Invalid expression
error: runtime error
error: Evaluating user parameter chr failed

root at vmx1> op test chr '''
''''':(null):(2) Invalid expression
error: runtime error
error: Evaluating user parameter chr failed

root at vmx1>


Script named test is following:

root at vmx1> file show /var/db/scripts/op/test.slax
version 1.1;

ns junos = "http://xml.juniper.net/junos/*/junos";
ns xnm = "http://xml.juniper.net/xnm/1.1/xnm";
ns jcs = "http://xml.juniper.net/junos/commit-scripts/1.0";

import "../import/junos.xsl";

var $arguments = {
        <argument> {
                <name> "chr";
        }
}

param $chr;

match / {
        <op-script-results> {
                <output> "Character: " _ "'" _ $chr _ "'";
        }
}

root at vmx1>

I guess it is not possible and one needs to use get-input() function?


thanks,
Martin


More information about the juniper-nsp mailing list