updating/re-writting the /etc/hosts file
Hi all
I have a problem, I need to read the hosts file for a string, and if the IP address for the name is incorrect i need to update the IP address and update it with the correct one then write it to the file
I have a script that sends the correct IP to the servers as a file, the problem is that I need to know how to update the hosts file with the new IP, I figured out how to read the file and store it in a field, but thats about it
The biggest thing is that I dont know much about bash, with the exception of basic functions, if you could point me in the right direction would help a lot
Thanks
|