Results 1 to 2 of 2
I need a shell script which will change the hostname , I need the script to prompt for a name if the name is localhost.localdomain.I am a newcomer in scripting. ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
- 11-28-2007 #1
- Join Date
- Nov 2007
Shell script to change host name
Thanks in advance
- 11-28-2007 #2
Is this homework?
Well I am not going to give you the script since helping with homework is not allowed on the forums.
but I can advice you.
There is a file were you can find the hostname.
The System reads it for the hostname.
If you write a script to extract that line out of the file. To show the current hostname and then change it.
Its really easy. Id do this with Perl if Id were you.
You'll need to read the file line by line. Till its the right string you are looking for
Hope I helped you without betraying something