When using “show run section” or “show run | section” or any other command involving the “section” capability, it looks like there may be some unexpected behavior with regexes that contain |.
rtr-edge1.sjc#show run section ?
For example if I am looking for configuration for sections route-map|prefix-list
show run section route-map|prefix-list
I only see configuration sections for route-map. If change it to prefix-list|route-map, I see at least some of both categories.
It looks like there may be some inconsistency in how regexes are parsed when | is involved?
If I put the regex in parentheses to turn it into a group, it works as-expected – however I consider this a workaround and not a resolution.
My guess is that something about the CLI parser does not handle the presence of a pipe symbol within an arugment correctly. While this is normal on a shell CLI, the usual fix of putting the arg in quotes is not permitted by EOS.
At the same time, if it was parsing the right hand side of the pipe as a new command (to pipe to), I would expect an error that “prefix-list” is not a recognized command. Curious.
Post your Answer
You must be logged in to post an answer.