拾贝者

If you can’t be replaced then you can’t be promoted!

Bash Shell: Take Control of PS1, PS2, PS3, PS4 and PROMPT_COMMAND

PS1 - to set the prompt string, ofcourse!
PS2 - to set the subshell prompt string, which by default is ">", when we enter a command half and press enter, we get the subshell prompt string which is >, then we can complete the command and press enter, it runs. We can change the > to something by modifying this var
PS3 - mostly used in ksh, this is used to define the prompt string displayed by 'select' command, which creates a menu, so in the menu, the prompt string for each option can be defined by changing this one
PS4- we can debug a shell script by putting a set -x while running it, this enables to print each command and then its results a + sign is put before each command, this "+" prompt string can be changed by defining the PS4 var.

 

http://www.thegeekstuff.com/2008/09/bash-shell-take-control-of-ps1-ps2-ps3-ps4-and-prompt_command/

 

http://pangaoyuan.iteye.com/blog/1154788

阅读更多
个人分类: linux 技巧
想对作者说点什么? 我来说一句

没有更多推荐了,返回首页

不良信息举报

Bash Shell: Take Control of PS1, PS2, PS3, PS4 and PROMPT_COMMAND

最多只允许输入30个字

加入CSDN,享受更精准的内容推荐,与500万程序员共同成长!
关闭
关闭