Command Looping |
Top Previous Next |
New with version 4.3.2 is the ability to send the same command(s) over and over without having to repeat those same commands over and over in the command input file. This is accomplished through the use of two keywords in the command file; LOOPSTART <num> and LOOPEND (all capital letters). All of the commands in between the LOOPSTART and LOOPEND commands will be repeated the number of times specified by the LOOPSTART command. The scripts that support this feature are
The best way to describe this is with an example. The example below will issue the show version command, then the show clock command. Then it will enter the show proc cpu and show memory stat commands 100 times (note there will be a 5 second delay between each iteration of the command being entered because of the SLEEP 5 command). After the loop ends, the show clock command will be entered once and the script is finished sending commands to that device.
show version
Note: Nested Loops are not supported.
|