<br><br>
<div><span class="gmail_quote">On 10/11/07, <b class="gmail_sendername">djgoku</b> <<a href="mailto:djgoku@gmail.com">djgoku@gmail.com</a>> wrote:</span>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">On 10/11/07, Emmanuel Mejias <<a href="mailto:emmanuel.mejias@gmail.com">emmanuel.mejias@gmail.com</a>> wrote:
<br>> trying to grep out some info from my /etc/hosts file...just to get more<br>> practice with Perl and well for my personal pleasure, too.<br>><br>> #!/usr/bin/perl<br>><br>> open (FILE, "/etc/hosts");
<br>> @lines = <FILE>;<br>> close (FILE);<br>><br>> foreach $line (@lines){<br>> if ($line =~ /pm1/){<br>> print $line;<br>> }<br>> }<br>><br>><br>> the problem with this is that it's printing out some hosts that i don't want
<br>> that also have pm1 at the end.<br>><br>> somehostpm1 but it also gets my dr hosts (dr-somehostpm1)<br>><br>> thoughts?<br><br>Are the ones you don't want all have a prefix of 'dr-'? Can we get a
<br>sample list?</blockquote>
<div> </div>
<div>correct!</div>
<div>cnxxpm1</div>
<div>cnxypm1</div>
<div>cnxzpm1</div>
<div> </div>
<div>dr-cnxxpm1<br>dr-cnxypm1<br>dr-cnxzpm1 <br>dr-cnabpm1<br>dr-cncdpm1<br> </div><br>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">> by the way, i had to jump the wifes car so i ended up missing out on the<br>> meeting. gonna try to make the next one for sure, though.
<br>_______________________________________________<br>kc mailing list<br><a href="mailto:kc@pm.org">kc@pm.org</a><br><a href="http://mail.pm.org/mailman/listinfo/kc">http://mail.pm.org/mailman/listinfo/kc</a><br></blockquote>
</div><br>