I’m posting this issue to the general list as it will affect users at the Terminal CLI, via SSH and Scripting.
In v5.12, don’t know about other variants, issuing a command including “print where xxx=xxx” to return a specific entry or a subset of entries, the index numbers returned are relative to the search, i.e. base of 0, and have no correlation whatsoever to that entry’s absolute index in a full listing. So extracting the index from a partial listing and performing some action is highly likely to affect the wrong record.
I don’t know if this is a bug or considered normal behaviour, either way it could catch out the unwary.
I’m trying to programmatically reset specific OpenVPN connections on over 200 routers using a Perl Expect script over SSH to disable, sleep, then enable. (Note: the connection being reset is NOT the one I’m communicating over). However, I cannot do this with “print where” and I can’t do ‘disable where connect-to=xxx’ or ‘enable where connect-to=xxx’.
Anyone got any idea how to do this without getting a complete list and parsing the entire output for the index I want?
There seems to be an option ‘print as-value’, but can’t find any documentation on this and it doesn’t seem to so anything.
Any help would be appreciated.