Hi there
I have a requirement where i have to globally remove a hosts file entry from all boxes e.g.
10.01.10.1 my_server1
normally for 'in-line' editing of files without passing it out to another fle and copying it back etc which is messy, Ive been using the fantastic "perl -pi -e" substitution command. However in this case I want to literally delete the line which im not sure that the perl command can do ?
But ....two things
I want to make sure i delete the line ONLY if both the ip AND the hostname are as defined (so that i know im deleting only this line)
and
the gap between the IP and hostname within the hosts file is variable with any potential number of spaces or tabs in between the two
Does anybody have an idea on how i can achieve this ?
Any help on this would be great