cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1451
Views
10
Helpful
6
Replies

problem with switchport description when using a script file

Frank C
Level 1
Level 1

When I try using plink to execute switchport description commands I am having a problem

 

interface fc1/9 ;
switchport description Server_1 ;
interface fc1/10 ;
switchport description Server_2 ;
EXIT

 

results in the port description for fc1/9 being changed to :

Server_1 ;interface fc1/10 ; switchport description Server_2 ;EXIT

 

I have tried enclosing the name in "" & '' but the quotes are just included in the description.

 

Other scripts using multiple lines that end with ; work fine. 

6 Replies 6

Frank C
Level 1
Level 1

I forgot to mention the switch is an MDS 9513 on version 6.2(19)

Try to have the script with each command in quotes with 'conf t' in the script and see if that works.

See the following document.

https://www.cisco.com/en/US/docs/storage/san_switches/mds9000/sw/rel_1_x/1_3/san-os/command/reference/CR01ntro.html#wp1257215

Rick1776
Level 5
Level 5
I don't see any example where it has the semicolon

I usually see the following..
switch# show file slot0:testfile
conf t
interface fc 1/1
no shutdown
end
sh interface fc1/1

Standard text.

See the following link page 54...
https://www.cisco.com/c/en/us/td/docs/switches/datacenter/mds9000/sw/4_1/configuration/guides/cli_4_1/clibook.pdf

Thanks for the replies but I think my situation is different. I am not logging onto the switch to execute the script. I use plink to run the commands from an external txt file

 

plink -load switch1 -m commands.txt > output.doc

 

I have been using conf t - just forgot to paste into the example.

 

I have to use ; for multiple lines and it works perfectly - the only problem I have is with the switchport description command as it doesn't seem to recognise where the text for the description ends. 

 

I tried enclosing in quotes but that fails with syntax error 

 

what if you separate the command by a ! for example

interface fc 1/1
!
no shutdown
!
end
!
sh interface fc1/1

also change it from a .doc format to a .txt format.