I am a new user for macbook,my environment variable is gone when my terminal input change from XXX@bogon to XXX@localhost, the terminal I am using is iTerm2 but I don't think it matter. The question is how I change XXX@localhost to XXX@bogon? Or how I get my environment variable? Besize, I click the menu named "New Window (Default Profile)" iTerm2, then my terminal becomes XXX@MacBook-Pro.
Asked
Active
Viewed 391 times
0
-
Terminal configuration is generally a better fit for [SuperUser](https://superuser.com/), [unix.se] or [apple.se] than StackOverflow; our focus here is specifically on writing code, or tools only used for that purpose -- whereas terminals/shells/etc. are a much broader topic with a wider audience. – Charles Duffy Aug 29 '18 at 17:02
-
That said, as something to be sure to expand on when you ask the question in a more appropriate forum -- when you say "my environment variable" -- where did you set that? Manually, with an `export`? In `.bashrc`? Somewhere else? – Charles Duffy Aug 29 '18 at 17:03
-
Also note that on a Mac, your hostname can change pretty frequently and without much notice, often based on what lease your DHCP server handed out. – Charles Duffy Aug 29 '18 at 17:03
-
The environment variables set with export and .bash_profile are all disappeared, but terminal becomes XXX@bogon automatically. It puzzles me, maybe I should try to reset enviroment variables, thank you for your answer. – Fancy Aug 30 '18 at 02:22
-
`export`ing an environment variable only applies to the current process and its children -- if you want to see them in a new tab, you'll want to put them in your dotfiles. *Which* dotfile to use for the purpose varies by operating system -- the rules about whether new terminal tabs or windows are login shells (which typically run `.bash_profile`) or interactive shells (which typically run `.bashrc`) vary between OS vendors. – Charles Duffy Aug 30 '18 at 03:47