Created
June 2, 2014 10:15
-
-
Save benmatselby/ea718b27a23b7fd16aaa to your computer and use it in GitHub Desktop.
Setting hostname on a mac
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
With all the machines I now use, and the fact I’m getting older and my memory is going, I needed to add hostname into my bash prompt for the first time, and came across a little issue on Apple’s Mac OS X Mountain Lion. | |
When I updated my PS1 setting I was getting: | |
``` | |
(null):~ | |
``` | |
Not so good. I was also getting similar responses when I was running “hostname” on the command line. | |
I’ve now found out how to resolve this issue on Mountain Lion: | |
``` | |
$ sudo scutil --set HostName [Your Hostname] | |
``` | |
This will now allow you to use “\h” in your PS1 setting and give you the correct result when running “hostname” |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment