UNIX Script To Remove Hosts from Hosts file

Discussion in 'Perl Misc' started by Bla, Apr 10, 2005.

  1. Bla

    Bla Guest

    Hello,

    Does anyone have a script that would remove the appropriate line from
    the hosts file on a UNIX box. This might be a tricky one?

    Let's say we have a list of hosts and associated ip's we wanted
    removed from the hosts file on a UNIX box....

    MAybe sed would do it? Would like a few suggestions.

    Thanks
    Bla, Apr 10, 2005
    #1
    1. Advertising

  2. Bla <> wrote:

    > Does anyone have a script that would remove the appropriate line from
    > the hosts file on a UNIX box.



    > MAybe sed would do it?



    Then you are in the wrong newsgroup. This is the Perl newsgroup.


    > Would like a few suggestions.



    1) Check the Perl FAQ before posting to the Perl newsgroup.

    perldoc -q file

    How do I change one line in a file/delete a line in a file/insert a
    line in the middle of a file/append to the beginning of a file?

    (note that this is the very same FAQ that I pointed out to you in July 2000,
    (assuming that you are that Mr. Horse Nuts), are you just now getting around
    to addressing that old task?
    )


    2) Show us the code you've written so far and we will help you fix it.




    Have you seen the Posting Guidelines that are posted here frequently?


    --
    Tad McClellan SGML consulting
    Perl programming
    Fort Worth, Texas
    Tad McClellan, Apr 10, 2005
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. dpackwood
    Replies:
    3
    Views:
    1,791
  2. Bla
    Replies:
    0
    Views:
    2,858
  3. Javier
    Replies:
    2
    Views:
    948
    Markus Schoder
    Oct 5, 2007
  4. Ilmari Heikkinen
    Replies:
    3
    Views:
    281
    Ilmari Heikkinen
    Dec 11, 2004
  5. Srikant
    Replies:
    1
    Views:
    491
    Greg Bacon
    Sep 29, 2007
Loading...

Share This Page