开发者

Syntax explanation for zenburn in shell placed in the .profile or .bashrc

I found this color scheme to enable zenburn in the bash shell. But I really do not understand what it does. Could someone shed some info as to what exactly this is doing.开发者_开发问答

function EXT_COLOR () { echo -ne "\033[38;5;$1m"; }
export LS_COLORS='di=38;5;108:fi=00:*svn-commit.tmp=31:ln=38;5;116:ex=38;5;186'
export PS1='`EXT_COLOR 187`\u@\h`EXT_COLOR 174` \w \$\[\033[00m\] > '


Function sets color (SGR). For more on escape sequences see eg. wikipedia LS_COLORS sets how to color different files/filetypes. This i never use, you should wait for someone else to answer.

Third line sets your multihued prompt: sets the color by using the function previously defined, outputs username (\u), then literal @, then hostname (\h), then changes color once again, outputs workdirectory (\w), then $ or # (depends on EUID), then sets color back to normal (\[ and \] are used to embed non-printing characters, see man bash/PROMPTING) and finally outputs greater-then symbol.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜