<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">You may need to also escape the / so...<div>'Do.*\(Y\/N\)\?' &nbsp;**NOTE that is not a V is it \ / together.<br><div>
<span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><br class="Apple-interchange-newline">Dave</span>
</div>
<br><div><div>On Jan 21, 2010, at 12:51 PM, Greg Brown wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">Hum... it's still hanging on that line. &nbsp;I'll keep plugging away. &nbsp;I'm sure it's tripping up on something in there. &nbsp;<div><br></div><div>Greg<br><br><div class="gmail_quote">On Thu, Jan 21, 2010 at 12:20 PM, Trevor Little <span dir="ltr">&lt;<a href="mailto:trevormg19@gmail.com">trevormg19@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Remember that parens and question marks are special in regular<br>
expressions, so you probably need something like this:<br>
<br>
'Do.*\(Y/N\)\?'<br>
<br>
Trevor<br>
<div><div></div><div class="h5"><br>
On Thu, Jan 21, 2010 at 12:14 PM, Greg Brown &lt;<a href="mailto:gwbrown1@gmail.com">gwbrown1@gmail.com</a>&gt; wrote:<br>
&gt; Ok, this is annoying.. my script works perfectly until the last line.. here<br>
&gt; are the last couple of lines:<br>
&gt;<br>
&gt; Primary DNS Server:&nbsp;&nbsp;&nbsp; 192.168.124.221<br>
&gt; Optional DNS Server:&nbsp;&nbsp;&nbsp; 192.168.134.29<br>
&gt; Is the above information correct (Y/N)?Y<br>
&gt; You must reboot the sensor to take the setting effects<br>
&gt; Do you want to reboot now(Y/N)?<br>
&gt;<br>
&gt; An oc -d of the last three lines looks like this:<br>
&gt;<br>
&gt; 0000000&nbsp;&nbsp; I&nbsp;&nbsp; s&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; t&nbsp;&nbsp; h&nbsp;&nbsp; e&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; a&nbsp;&nbsp; b&nbsp;&nbsp; o&nbsp;&nbsp; v&nbsp;&nbsp; e&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; i&nbsp;&nbsp; n&nbsp;&nbsp; f<br>
&gt; 0000020&nbsp;&nbsp; o&nbsp;&nbsp; r&nbsp;&nbsp; m&nbsp;&nbsp; a&nbsp;&nbsp; t&nbsp;&nbsp; i&nbsp;&nbsp; o&nbsp;&nbsp; n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; c&nbsp;&nbsp; o&nbsp;&nbsp; r&nbsp;&nbsp; r&nbsp;&nbsp; e&nbsp;&nbsp; c&nbsp;&nbsp; t<br>
&gt; 0000040&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (&nbsp;&nbsp; Y&nbsp;&nbsp; /&nbsp;&nbsp; N&nbsp;&nbsp; )&nbsp;&nbsp; ?&nbsp;&nbsp; Y&nbsp; \n&nbsp;&nbsp; Y&nbsp;&nbsp; o&nbsp;&nbsp; u&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; m&nbsp;&nbsp; u&nbsp;&nbsp; s<br>
&gt; 0000060&nbsp;&nbsp; t&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; r&nbsp;&nbsp; e&nbsp;&nbsp; b&nbsp;&nbsp; o&nbsp;&nbsp; o&nbsp;&nbsp; t&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; t&nbsp;&nbsp; h&nbsp;&nbsp; e&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; s&nb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
&gt;<br>
&gt; I have tried *EVERYTHING* to match that last line including:<br>
&gt;<br>
&gt; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # now it tells us we must reboot (which we just told it we wanted to<br>
&gt; do).. so send another Y<br>
&gt; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; my($which, $why, $match, $before, $after) =<br>
&gt; $ssh-&gt;expect(30,'-re','You.*');<br>
&gt;<br>
&gt; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # now it tells us we must reboot (which we just told it we wanted to<br>
&gt; do).. so send another Y<br>
&gt; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; my($which, $why, $match, $before, $after) = $ssh-&gt;expect(30,'*');<br>
&gt;<br>
&gt; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # now it tells us we must reboot (which we just told it we wanted to<br>
&gt; do).. so send another Y<br>
&gt; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; my($which, $why, $match, $before, $after) =<br>
&gt; $ssh-&gt;expect(30,'-re','You.*(Y/N)?');<br>
&gt;<br>
&gt; I've even tossed out the "You" and started with "Do"... and I've tried to<br>
&gt; take the "magic match any darn thing" too.<br>
&gt;<br>
&gt; And a thousand other combinations and nothing works.&nbsp; Does anyone have any<br>
&gt; ideas?&nbsp; this is really giving me a headache..&nbsp; The line above ends much the<br>
&gt; same, but not exactly, but I've matched that and using the line below and it<br>
&gt; works fine... ugh.&nbsp; Any ideas would be very welcomed at this point...<br>
&gt;<br>
&gt; # now it wants to know if you want to reboot (and we do)<br>
&gt; my($which, $why, $match, $before, $after) =<br>
&gt; $ssh-&gt;expect(30,'-re','The.*(Y/N)?');<br>
&gt;<br>
&gt; Greg<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
</div></div>&gt; _______________________________________________<br>
&gt; Trilug-ontopic mailing list<br>
&gt; <a href="mailto:Trilug-ontopic@trilug.org">Trilug-ontopic@trilug.org</a><br>
&gt; <a href="http://www.trilug.org/mailman/listinfo/trilug-ontopic" target="_blank">http://www.trilug.org/mailman/listinfo/trilug-ontopic</a><br>
&gt;<br>
&gt;<br>
_______________________________________________<br>
Trilug-ontopic mailing list<br>
<a href="mailto:Trilug-ontopic@trilug.org">Trilug-ontopic@trilug.org</a><br>
<a href="http://www.trilug.org/mailman/listinfo/trilug-ontopic" target="_blank">http://www.trilug.org/mailman/listinfo/trilug-ontopic</a><br>
</blockquote></div><br></div>
_______________________________________________<br>Trilug-ontopic mailing list<br><a href="mailto:Trilug-ontopic@trilug.org">Trilug-ontopic@trilug.org</a><br>http://www.trilug.org/mailman/listinfo/trilug-ontopic<br></blockquote></div><br></div></body></html>