[rancid] clogin with command file - special signs (solved)
alligator94
alligator94 at laposte.net
Wed Oct 31 17:15:01 UTC 2012
thanks all for your help.
I have added the backslashes(even before "ooo") and it works fine now :
rrr\!\@\$\ooo
Regards,
Gilles
-----Message d'origine-----
De : rancid-discuss-bounces at shrubbery.net
[mailto:rancid-discuss-bounces at shrubbery.net] De la part de Chris Gauthier
Envoyé : mercredi 31 octobre 2012 16:37
À : rancid-discuss at shrubbery.net
Objet : Re: [rancid] clogin with command file - special signs
>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.
_______________________________________________
Rancid-discuss mailing list
Rancid-discuss at shrubbery.net
http://www.shrubbery.net/mailman/listinfo.cgi/rancid-discuss
More information about the Rancid-discuss
mailing list