--- functions_old 2008-03-26 15:35:21.000000000 +0300 +++ functions 2008-03-28 11:30:04.000000000 +0300 @@ -320,12 +320,12 @@ function change_hostname() $0 == comm {found = 1; next} found { if (ip == "") {ip = $1} - next; + if (NF) {found = 0} + next; } - $2 == host && !found {skip = 1} - $1 == "127.0.0.1" { - print "127.0.0.1 localhost.localdomain localhost"; - next; + $0 ~ "\\<" host "\\>" { + if (!skip) {skip = 1} + else {next} } {print} END {