期望的效果如下:
[xport@bsdws01 bin] $
Bash 设定为:
PS1='/n[/[/033[32m/]/u@/h /[/033[33m/]/w/[/033[0m/]]/$/[/033[0m/] '
export PS1
C Shell 设定为:
alias setprompt 'set prompt = "/n[%{/033[32m%}%n@%m %{/033[33m%}${cwd}%{/033[0m%}]# "'
setprompt # to set the initial prompt
alias cd 'chdir /!* && setprompt'
博客介绍了Bash和C Shell命令行提示符的设定方法。给出了Bash设定提示符的代码,以及C Shell设定提示符的别名和相关命令,帮助用户实现期望的命令行显示效果。
1291

被折叠的 条评论
为什么被折叠?



