I'm attempting to extract some info from a bunch of routers, and I'm trying to determine the best way to do something. The script logs in, then runs a command. The output of the command is variable. Typically it is nothing (I'm looking for unusual states).
So typical output:
router> command
router>
In the above case I do not want to save anything. However in another case:
router> command
OUTPUT OF ISSUE #1
OUTPUT OF ISSUE #2
<usually only one issue but multiples possible>
router>
I would like to save the name of the current router (trivial) and the output, which I would then put in a file. The problem is how to format the EXPECT command to deal with variable input. Any ideas?
Thanks, Jeff
So typical output:
router> command
router>
In the above case I do not want to save anything. However in another case:
router> command
OUTPUT OF ISSUE #1
OUTPUT OF ISSUE #2
<usually only one issue but multiples possible>
router>
I would like to save the name of the current router (trivial) and the output, which I would then put in a file. The problem is how to format the EXPECT command to deal with variable input. Any ideas?
Thanks, Jeff