Change parameter of /etc/sysconfig/network with a script
I'm a newbie in linux and I'm trying to make a script to change the hostname PC.
I get the hostname in $1.
My question are :
By using a script
1) How can I set this value in /etc/sysconfig/network "HOSTNAME=..."
2) How can I add this hostname in /etc/hosts
"127.0.0.1 localhost.localdomain localhost ..."
Thanks in advance for your help.