text processing and cutting
Hi all,
I've ran a CentOS 5 for which i want to change the hostname by script.
the desired clue is to replace the previous hostname with the one which asked from the user who executing the script. below is content of /etc/hosts.
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1 example.domain.com example localhost.localdomain localhost
::1 localhost6.localdomain6 localhost6
how to process the "example.domain.com" "example" using awk command and replace with new one?
|