cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Bookmark
|
Subscribe
|
1833
Views
0
Helpful
2
Replies

basic ssh script for show commands

erdos_jonathan
Level 1
Level 1

Hello- I am looking to create a basic script to run through ssh and output some show commands. I have created so far a basic .bat file which points to a .txt file that includes the show commands. However, when I execute the .bat it points to the .txt file and runs fine when I only have one show command line in the .txt file. When I add a second line to the .txt file ie: show module

show version

I receive a 'Cmd Parse error' in the output log.

Any ideas? I am looking to avoid uploading a .txt file to bootflash:, as well as avoiding using the cmd 'run script'. I'd like to keep the cmd's external to the switch.

Thanks!

2 Replies 2

glen.grant
VIP Alumni
VIP Alumni

Are you hitting an enter key after each command , otherwise it may think you are doing one continuous command.

The .txt file with the commands has no special syntax within the commands.

ie:

show module

show version

It will output with only the first line - show module, but any other command lines, it gives a 'cmd parse error'.

Is there a specific syntax that the switch needs to read to move down to the next line?