in reply to Re: one liner with separate input file?
in thread one liner with separate input file?

Thanks for responding Laurent_R.

I don't think I need to worry about the edge cases. I did several steps before I got here, with massaging and normalizing the data. Your solution is like jeffa's. It seemed to execute, but did not edit the file to be worked on. I did add the name of that file to the end of the command you suggested.

I'll keep poking at this as time permits.

  • Comment on Re^2: one liner with separate input file?

Replies are listed 'Best First'.
Re^3: one liner with separate input file?
by Laurent_R (Canon) on Apr 15, 2015 at 20:53 UTC
    True, I forgot to add the name of the file at the end of the command line. Sorry about that.

    But I can't say what went wrong with what you are saying in your comments.

    Please give full details on what you are trying: exact command line used, sample input files, OS on which you are working, any other thing worth of interest (such as warnings or errors).

    Je suis Charlie.
      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.