Martin T
2018-07-12 08:00:12 UTC
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:
***@vmx1> op test chr '
''':(null):(2) Invalid expression
error: runtime error
error: Evaluating user parameter chr failed
***@vmx1> op test chr "'"
''':(null):(2) Invalid expression
error: runtime error
error: Evaluating user parameter chr failed
***@vmx1> op test chr \'
'\'':(null):(3) Invalid expression
error: runtime error
error: Evaluating user parameter chr failed
***@vmx1> op test chr '''
''''':(null):(2) Invalid expression
error: runtime error
error: Evaluating user parameter chr failed
***@vmx1>
Script named test is following:
***@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 _ "'";
}
}
***@vmx1>
I guess it is not possible and one needs to use get-input() function?
thanks,
Martin
_______________________________________________
juniper-nsp mailing list juniper-***@puck.nether.net
https://puck.nether.net/mailman/listinfo/juniper-nsp
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:
***@vmx1> op test chr '
''':(null):(2) Invalid expression
error: runtime error
error: Evaluating user parameter chr failed
***@vmx1> op test chr "'"
''':(null):(2) Invalid expression
error: runtime error
error: Evaluating user parameter chr failed
***@vmx1> op test chr \'
'\'':(null):(3) Invalid expression
error: runtime error
error: Evaluating user parameter chr failed
***@vmx1> op test chr '''
''''':(null):(2) Invalid expression
error: runtime error
error: Evaluating user parameter chr failed
***@vmx1>
Script named test is following:
***@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 _ "'";
}
}
***@vmx1>
I guess it is not possible and one needs to use get-input() function?
thanks,
Martin
_______________________________________________
juniper-nsp mailing list juniper-***@puck.nether.net
https://puck.nether.net/mailman/listinfo/juniper-nsp