Scripting How-To: Invoke a command from script that does not have the corresponding RPC defined in Junos OS

by on ‎08-10-2015 12:31 PM - edited on ‎09-15-2017 04:24 PM by Administrator Administrator (1,057 Views)

If there is no respective RPC for a Junos OS CLI command, then the command can be executed from script using <command> RPC:

1	var $cmd = <command> "show version";
2	var $res = jcs:invoke($cmd);

Piped commands should not be used with <command> RPC. They are not supported. The following is an invalid command:

1	var $cmd = <command> "show version | display detail";