Why am I not "localhost" anymore?

Jorgen

Registered
In 10.1 (5G64) I´m not [localhost] user% anymore, just [as2-6-1] user%. Anyone knows why this happend to the terminal? And does it matter?
 
Yes I have. Is there something I can do about this. I know hardly anything about UNIX. Can You explane what I must do to correct this?
 
I don't know much myself, but the first thing you should do is check the Terminal preferences, in particular under "Shell" and make sure that "Read login script" is checked. If it is already checked (or it wasn't, but opening up a new terminal still has that problem), then check for the file tcsh.defaults in the same folder as the rc file. Check to see if this is written somewhere in it:

# Set up prompt
set promptchars = "%#"
if ("$version" =~ tcsh*) then
set prompt = "[%m:%c3] %n%# "
else
if ($uid) then
set prompt = "[$host] $user% "
else
set prompt = "[$host] $user# "
endif
endif
set prompt2 = "%R -> " # if/while prompt
set prompt3 = "OK? %R? " # Spell correction prompt


I wish I could give one straight answer, but my understanding of how the login scripts are checked means that things could go wrong anywhere. If this doesn't work, then hopefully someone else with have some ideas, because I'm quickly running out of them.
 
This may sound kinda stupid but what is your computers name? I have heard some people say they fixed the problem that naming your computer in Aqua didn't change it in the BSD layer. If your computers name is 'as2-6-1' then it seems like everything is working correctly.

Try typing 'hostname' at the prompt and see what it gives you back, if that is giving you back localhost then something is wrong in your prompt definition.
 
I wrote hostname in the terminal and the repy was:
as2-6-1.um.bonet.se
Bonet is my internet serviceprovider. I live in Sweden in a town named Umea.
Could "as2-6-1.um.bonet.se " be some sort of adress to my computer in my internet serviceproviders network? And if so why has it become my computer name? Pleas explane, and can I change this?
 
Thanks LordOphidian!
I dont know what coused the problem, but it was easy to fix.
I just wrote "sethostname localhost" and closed the window. I opened a new one and it said "localhost". I hope this dont effect my internet connection, but i don´t think so.
So, I learn something new every day.
Thanks very much for your help
 
This is normal behavior for most linux/unix computers. If you want to change it, edit the file /etc/hostconfig.
(go into terminal, type sudo pico /etc/hostconfig)

Here is how the top of mine looks:
# Network configuration
HOSTNAME=mach4
ROUTER=-AUTOMATIC-

So, just set HOSTNAME to whatever you wish. Its a good idea to make an intery inro netinfo about this, just add another property to /computer/macheins/127.0.0.1. I'm not at my Mac OS X computer, so you'll have to just give it a shot and tell us if it doesn't work.

To save a file from pico, which is the text editor lots of people use from the command line, press control-o (thats the letter oh). Then press enter. To exit, control-x.

If you have any more questions, please ask!
 
Back
Top