Localhost 不見了...

本區專門提供 Mac OS X 使用者交換使用心得

版主: ross_ttbryanchangdigdogchester

回覆文章
內容
發表人
vingtaine
基本會員
文章: 33
註冊時間: 05/01/2001 1:01 am

Localhost 不見了...

#1 文章 vingtaine »

昨天是寫了些 c program, 沒有更改設定, 今天早上開機之後, terminal 的 prompt

[localhost:~] myname%
變成
[:~] myname%

如何把他復原, 或是改成別的名字呢?

Thanks!
頭像
paladin
留言破百
文章: 248
註冊時間: 08/10/2001 1:01 am
來自: Tokyo/Japan

Localhost 不見了...

#2 文章 paladin »

In C shell, the variable "prompt" stores the style of shell prompt. Change it by

set prompt="something"

The default value is

set prompt="[%m:%c3] %n%#"

where %m stands for your machine name, %c3 is the truncated current working directory, %n is the username. I don't know what %# is for. [img]images/smiles/icon_smile.gif[/img] On my computer it looks like:

[dhcpa4:~] scm%

In ordinary UNIXes you would put the above "set prompt=..." command in a file called .cshrc so it is executed each time you enter the shell. In OS X they have altered the mechanism a bit and I do not have the info at hand... anyone?

Hope that helps. [img]images/smiles/icon_smile.gif[/img]
回覆文章