On my PowerBook, Terminal gives me a prompt like...
But on my iMac, Terminal gives me a prompt like...
...where the x's are digits. Does anyone know why it shows "user-xxlxxkx" instead of the computer name? Both machines are running bash, OS 10.4.6.
My reference book, The Mac OS X Command Line - Unix Under the Hood, just says that this part should be the computer name as shown on the Sharing panel under System Preferences. But my iMac's name is simply "imac-g5". [ May 10, 2006: Message edited by: marc weber ]
"We're kind of on the level of crossword puzzle writers... And no one ever goes to them and gives them an award." ~Joe Strummer sscce.org
Update: I've noticed that this only happens when my iMac is connected to the internet. When it's not connected, the correct name shows in the prompt.
It was suggested on the Apple boards that when I'm connected to my ISP's network, this might be the node name on that network rather than my computer's "given" name.
Does this make sense? I'm not network savvy, and I just want to make sure that something isn't misconfigured. (I connect differently with my PowerBook, so it makes sense that I would only see this on my iMac.)
Yes, it makes sense if these two things are different.
The prompt is controlled by an idiosyncratic little code in the environment variable "PS1". The first component by default is "\h", which represents the host name. To learn how to customize the prompt, say "info bash", and then in the info program "/PS1" to find a link to the "Printing a Prompt" page, which explains all the codes.