在什么情况下使用PS3和PS4?

在什么情况下使用PS3和PS4?

在什么情况下使用PS3和PS4?      
复制内容到剪贴板
代码:
[color=blue]-(user@host:tty)-(tmp)-
[3932 0] $ [/color]PS2='This is PS2> '
[color=blue]-(user@host:tty)-(tmp)-
[3932 0] $ [/color]if true; then
[color=red]This is PS2>[/color] echo hello
[color=red]This is PS2>[/color] fi
hello
[color=blue]-(user@host:tty)-(tmp)-
[3932 0] $ [/color]PS3='This is PS3> '
[color=blue]-(user@host:tty)-(tmp)-
[3932 0] $ [/color]select i in a b c; do echo "You chosed '$i'"; done
1) a
2) b
3) c
[color=red]This is PS3>[/color] 1
You chosed 'a'
[color=red]This is PS3>[/color] 2
You chosed 'b'
[color=red]This is PS3>[/color] 3
You chosed 'c'
[color=red]This is PS3>[/color] ^D
[color=blue]-(user@host:tty)-(tmp)-
[3932 0] $ [/color]cat foo.sh
if [ 1 = 1 ]; then
    echo hello
fi
[color=blue]-(user@host:tty)-(tmp)-
[3932 0] $ [/color]bash -x foo.sh
[color=red]+[/color] '[' 1 = 1 ']'
[color=red]+[/color] echo hello
hello
[color=blue]-(user@host:tty)-(tmp)-
[3932 0] $ [/color]PS4='This is PS4> ' bash -x foo.sh
[color=red]This is PS4>[/color] '[' 1 = 1 ']'
[color=red]This is PS4>[/color] echo hello
hello
[color=blue]-(user@host:tty)-(tmp)-
[3932 0] $ [/color]
      
一般情况下,没有必要自己设置 PS2, PS3 和 PS4      
十分感谢!
我正在学习bash的menu手册,真的很累,但也很有收获,希望斑竹多指点!      
俺也是现学现卖