bash – PS1和PROMPT_COMMAND之间的区别是什么

虽然看看 this awesome thread我注意到一些例子使用
PS1="Blah Blah Blah"

和一些使用

PROMPT_COMMAND="Blah Blah Blah"

(和一些使用两者)在一个bash shell中设置提示。两者之间有什么区别? SO搜索,甚至一些更广泛的谷歌搜索没有得到我的结果,所以即使链接到正确的地方寻找答案将不胜感激。谢谢!

从GNU Bash文档页面http://www.gnu.org/software/bash/manual/bashref.html
PROMPT_COMMAND
    If set,the value is interpreted as a command to execute before
    the printing of each primary prompt ($PS1).

我从来没有使用它,但我可以用这个回来,当我只有sh。

相关文章

用的openwrt路由器,家里宽带申请了动态公网ip,为了方便把2...
#!/bin/bashcommand1&command2&wait从Shell脚本并行...
1.先查出MAMP下面集成的PHP版本cd/Applications/MAMP/bin/ph...
1、先输入locale-a,查看一下现在已安装的语言2、若不存在如...
BashPerlTclsyntaxdiff1.进制数表示Languagebinaryoctalhexa...
正常安装了k8s后,使用kubect工具后接的命令不能直接tab补全...