关闭

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

515人阅读 评论(0) 收藏 举报

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

0
0

查看评论
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
    个人资料
    • 访问:505526次
    • 积分:6655
    • 等级:
    • 排名:第3696名
    • 原创:129篇
    • 转载:367篇
    • 译文:0篇
    • 评论:14条
    文章分类
    最新评论