<html>
<head>
<meta content="text/html; charset=windows-1252"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix">On 11/10/16 17:14, Chris Davis wrote:<br>
</div>
<blockquote
cite="mid:CY4PR02MB2776C24E48E58F47A189FC2CF3DA0@CY4PR02MB2776.namprd02.prod.outlook.com"
type="cite">
<meta http-equiv="Content-Type" content="text/html;
charset=windows-1252">
<meta name="Generator" content="Microsoft Word 15 (filtered
medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:#0563C1;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:#954F72;
text-decoration:underline;}
span.EmailStyle17
{mso-style-type:personal-compose;
font-family:"Calibri",sans-serif;
color:windowtext;
font-weight:normal;
font-style:normal;
text-decoration:none none;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;
font-family:"Calibri",sans-serif;}
@page WordSection1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:12.0pt">for host in
“list of switch IP addresses”; do clogin -c "config t;<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:12.0pt">enable
secret 5 $8$VNEb$ait.ADc45ru5cDNQEGa/.<o:p></o:p></span></p>
</div>
</blockquote>
...<br>
<blockquote
cite="mid:CY4PR02MB2776C24E48E58F47A189FC2CF3DA0@CY4PR02MB2776.namprd02.prod.outlook.com"
type="cite">
<div class="WordSection1"><span style="font-size:12.0pt"><o:p></o:p></span>
<p class="MsoNormal"><span style="font-size:12.0pt">end; write
memory;" $host > /tmp/$host.log & done<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:12.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:12.0pt">The Cisco
CLI barks at the encrypted string and the rest of the
commands work as expected.
<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:12.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:12.0pt">Hostname(config)#enable
secret 5 .ADc45ru5cDNQEGa/.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:12.0pt">ERROR: The
secret you entered is not a valid encrypted secret.<o:p></o:p></span></p>
<br>
</div>
</blockquote>
...<br>
<blockquote
cite="mid:CY4PR02MB2776C24E48E58F47A189FC2CF3DA0@CY4PR02MB2776.namprd02.prod.outlook.com"
type="cite">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:12.0pt">As I write
this, I suspect it’s the bash shell that’s mangling
things. Any thoughts?
<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:12.0pt">Chris<o:p></o:p></span></p>
</div>
<br>
</blockquote>
<p><br>
</p>
<p>No doubt, bash is expanding the $string to nothing. You either
need to escape the $ or put some more/different quotes around it.</p>
<p><br>
</p>
<p>alexd<br>
</p>
</body>
</html>