Hi, jcs:break-lines() function in SLAX allows one to break content into multiple lines. For example here I break the output of "show chassis mac-addresses" into lines:
version 1.0; ns jcs = "http://xml.juniper.net/junos/commit-scripts/1.0"; match / { <op-script-results> { var $sh_mac_results = jcs:invoke( "get-chassis-mac-addresses" ); var $line = jcs:break-lines( $sh_mac_results ); <output> $line; } } However, script above returns an empty line. Now if I add for example index "0" or "1" to "$line" variable, then nothing changes. If I add index "2"(e.g <output> $line[2];), then the first line of "show chassis mac-addresses" command is printed: root@M10i> op RE MAC address information: root@M10i> How are those indexes numbered? Only thing that I can think of is that those are indexed from zero and first line is "<rpc-reply xmlns:junos="http://xml.juniper.net/junos/13.3R8/junos">" which is not printed, second line is "<output>" which is also not printed and then the third line would be "MAC address information:". However, I could easily be wrong. Indexes in jcs:regex() are well documented and logical, but I could not find any information regarding indexes for jcs:break-lines() function.. thanks, Martin _______________________________________________ juniper-nsp mailing list juniper-nsp@puck.nether.net https://puck.nether.net/mailman/listinfo/juniper-nsp