Warning: Undefined array key "rcommentid" in /home/clabr/public_html/movingpackets/wp-content/plugins/wp-recaptcha/recaptcha.php on line 348

Warning: Undefined array key "rchash" in /home/clabr/public_html/movingpackets/wp-content/plugins/wp-recaptcha/recaptcha.php on line 349
NXOS - Syntax Error at Line 5020 - MovingPackets.net

NXOS – Syntax Error at Line 5020

A short post today; I found some interesting error reporting in NXOS, and wanted to quickly share for your amusement.

Syntax Fun

In the example below, I’m trying to filter the list of interface descriptions, but I forgot to add the “inc” after the pipe (\):

router11# sh int desc | svr
                 ^
Invalid command (interface name) at ‘^’ marker.

Curiously, NXOS points to “desc” as the source of the error, indicating that it was expecting an interface name; but the command itself is perfectly valid. Expanding the keywords (show interface description) makes no difference to the error.

Maybe it’s something about the description keyword, so let me give NXOS the interface name it was hoping for:

router11# sh int e1/24 | mtu
                     ^
Invalid command (too many ranges) at ‘^’ marker.

Whaaaa? Well, that went in a direction I didn’t expect!

I don’t envy anybody who has to write a command interpreter (LEX for the win?), but I find it fascinating to consider how these commands must have been parsed internally to end up generating these specific errors.

Be the first to comment

Leave a Reply

Your email address will not be published.


*



Warning: Undefined array key "rerror" in /home/clabr/public_html/movingpackets/wp-content/plugins/wp-recaptcha/recaptcha.php on line 291
 

This site uses Akismet to reduce spam. Learn how your comment data is processed.