Automating configuration with cli scripts

Agreed… you should really be using the RESTful SEMPv2 management API, rather than scripting CLI scripts and trying to execute them remotely. It’s much safer, cleaner, and doesn’t run the the risk of leaving the system in a weird/bad state if a CLI script fails halfway through a configuration item. CLI scripts were great 10 years ago, but SEMPv2 is very much the recommended way of going now.

For your example, here’s how you can create a queue with SEMP in a single command:

curl http://localhost:8080/SEMP/v2/config/msgVpns/default/queues \
-X POST \
-u admin:admin \
-H "Content-type:application/json" \
-d '{ "queueName":"testQ",
      "accessType":"exclusive",
      "maxMsgSpoolUsage":200,
	  "permission":"consume",
      "ingressEnabled":true,
      "egressEnabled":true }'