Yes, but then I have to create a file, write the commands I want to run to the file, run the commands, deal with clish's extraneous output from running commands from a file, then clean up the file afterwards. All to get an approximation of functionality which worked before but which has broken.
This is the extraneous output I mean:
[Expert@MyVsxMember1:0]# cat clishScript.txt
set virtual-system 12
show router-id
[Expert@MyVsxMember1:0]# clish -f clishScript.txt
Context is set to vsid 122
Processing line 2 out of 2
Router ID: 10.2.3.4
Done.
[Expert@MyVsxMember1:0]# clish -f clishScript.txt 2>/dev/null
Context is set to vsid 122
Processing line 2 out of 2
Router ID: 10.2.3.4
Done.
[Expert@MyVsxMember1:0]# clish
MyVsxMember1:0> set virtual-system 12
Context is set to vsid 12
MyVsxMember1:12> show router-id
Router ID: 10.2.3.4
MyVsxMember1:12>
Context is set to vsid 122? Clearly it's printed on top of "Processing line 1 of 2", but are you kidding me? The only reason the router ID doesn't show up as "10.2.3.4t of 2" is that the clish command 'show router-id' prints an otherwise-unnecessary newline first.
The extra output is in STDOUT, so I can't just use 2>/dev/null to discard it.
The command files don't appear to accept any sort of variable, so if I want to write a script to get the router IDs of all 30 VSs, I have to rewrite the file for every single one. Not insurmountable, but needlessly inconvenient.
XML output helps with some of this, but there aren't tools on-box to deal with it.
Previously, to get the router ID on all of my VSs, I just had to run this:
for vsid in $(ip netns list | cut -d' ' -f3 | sed 's/)//' | sort -g);do vsenv "$vsid" 2>&1 >/dev/null;printf "%5s: " "$vsid";echo "$(printf "set virtual-system $vsid\nshow router-id\n" | clish | grep Router | awk '{print $NF}')";done
It's not the prettiest, but it worked well and is relatively clean. Now I need all that plus file handling.