[rancid] clogin with command file - special signs

Chris Gauthier cgauthier at mapscu.com
Wed Oct 31 15:36:33 UTC 2012


>From: rancid-discuss-bounces at shrubbery.net [mailto:rancid-discuss-bounces at shrubbery.net] On Behalf Of alligator94
>Sent: Wednesday, October 31, 2012 8:21 AM
>To: rancid-discuss at shrubbery.net
>Subject: [rancid] clogin with command file - special signs
>
>Dear all,
>
>I would like to use the command "clogin -x file.txt  device-name" to add a snmp configuration in a lot of cisco devices. The community string includes the characters   !@$ and the clogin command is rejected.
>I also have tried to use the -c option and to quote the commands, but I get the same error message
>
>ex : 
>clogin -x "conf t ; snmp-server community rrr!@$ooo RW my_acl; end; wr; q" device_name
>
>I get the message :
>
>-su !@$ooo event not found 
>
>
>Is there a workaround ?
>
>Thanks
>Gilles
>

I believe you can escape those characters or put them inside a single-quote to make it a more literal translation.  I have given examples of both below.  I think that option 1 will probably work better, but don't hold me to that.

1) clogin -x "conf t ; snmp-server community rrr\!\@\$ooo RW my_acl; end; wr; q" device_name
2) clogin -x 'conf t ; snmp-server community rrr!@$ooo RW my_acl; end; wr; q' device_name

Chris

------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
CONFIDENTIALITY NOTICE
Attention: The information contained in this email and/or attachments is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is prohibited. If you received this in error, please contact the sender and delete the material from any system and destroy any copies.


More information about the Rancid-discuss mailing list