Hi Laurent_R.

Over the past few days, I've been continuing to work on doing this in a perl script instead of a one-liner. I have made some progress. I does exactly what I want when the ip_addr file contains 1 ip address. I tested it again with 3, and it does the first ip address, and does not do the 2nd or 3rd. I figure if I can do it for 3, then I can do it for N ip addresses.

I'm doing this in Solaris 10, to answer your question. The current sate of the script is a mess with comments and print statements akimbo.

If this was vi, I'd be doing this:
:g/66.11.22.23/s/^/#/

The problem is that I have several hundred ip addresses. Thanks for the response, regardless.


In reply to Re^4: one liner with separate input file? by MrGibbs
in thread one liner with separate input file? by MrGibbs

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.