Quick question Re: computer identity crisis

Discussion in 'Mac Apps and Mac App Store' started by Simon Liquid, Jan 7, 2005.

  1. Simon Liquid macrumors regular

    Joined:
    Jul 4, 2001
    Location:
    Iowa
    #1
    In the Terminal, the prompt has always been my computer's name, as set in the Sharing control panel, and my user name. I got cable internet a few days ago and since then it's used my IP address instead of computer name. Does anyone know how to make it go back the other way? It never changed when I used my modem or airport, if I remember correctly. It's just a little annoying, I could probably live with it.
     
  2. gekko513 macrumors 603

    gekko513

    Joined:
    Oct 16, 2003
    #2
    bash lets you customize the prompt: here's how

    For example. To have a prompt like this:

    superMac:~ Simon$

    You add the following line in the .profile file in your home directory. If there is no .profile file just create one.

    PS1="superMac:\w \u$"

    The \w is replaced with the current working directory and the \u is replaced the current username. The reason why your Mac seems to have a personality disorder is that the default prompt uses \h which is replaced by the current hostname. The hostname can be set by a DHCP server when you connect to a network, but if you're not connected to a network it is just set to the computer name you have given yourself.

    If you're not sure how to edit the .profile file you can use the editor pico:
    pico .profile
     
  3. Simon Liquid thread starter macrumors regular

    Joined:
    Jul 4, 2001
    Location:
    Iowa

Share This Page