Re: [j-nsp] How to catch invalid value/option for a command in SLAX script?

2016-07-11 Thread Tore Anderson
* Phil Shafer > But the newlines are my fault. The initial XML output for JUNOS > generated newlines after each tag open/close/data call to ease > debugging for developers, and also because I thought it would make > the XML->text renderer in the CLI easier. By the time I realized > the latter w

Re: [j-nsp] How to catch invalid value/option for a command in SLAX script?

2016-07-11 Thread Phil Shafer
Martin T writes: >Thanks for the reply! Did I understand you correctly that "if( >$variable == "usb0\ninvalid value" ) {" is actually "if( string( >$variable ) == "usb0\ninvalid value" ) {" and the string() inserts a >newline at the beginning and in the end of the string? Based on the >debugger out

Re: [j-nsp] How to catch invalid value/option for a command in SLAX script?

2016-07-11 Thread Martin T
Thanks for the reply! Did I understand you correctly that "if( $variable == "usb0\ninvalid value" ) {" is actually "if( string( $variable ) == "usb0\ninvalid value" ) {" and the string() inserts a newline at the beginning and in the end of the string? Based on the debugger output it looks like so:

Re: [j-nsp] How to catch invalid value/option for a command in SLAX script?

2016-07-09 Thread Phil Shafer
Martin T writes: >I have a following simple SLAX script which executes "show system >snapshot media usb0" command in an environment where "usb0" option for >"show system snapshot" command is unavailable: I can't reproduce this on my test box ("command is not valid on the m7i"), but the best way to

[j-nsp] How to catch invalid value/option for a command in SLAX script?

2016-07-08 Thread Martin T
Hi, I have a following simple SLAX script which executes "show system snapshot media usb0" command in an environment where "usb0" option for "show system snapshot" command is unavailable: root> file show /var/db/scripts/op/template_test.slax | no-more version 1.1; ns junos = "http://xml.juniper.