Параметр "-h" в сценарии оболочки "пока" условие

Изman bash:

PS1    The value of this parameter is expanded (see PROMPTING below) and used as the primary prompt string.  The default value is ``\s-\v\$ ''.
PS2    The value of this parameter is expanded as with PS1 and used as the secondary prompt string.  The default is ``> ''.
PS3    The value of this parameter is used as the prompt for the select command (see SHELL GRAMMAR above).
PS4    The value of this parameter is expanded as with PS1 and the value is printed before each command bash displays  during  an  execution  trace.   The

Итак, по какой-то причине не -расширение PS3является задокументированным поведением.

Что касается PS4, вам нужно экспортировать переменную, чтобы сделать ее доступной при новом вызове bash. И вам нужно явно установить параметр трассировки, -vне включает его:

pse@Mithos:~/.tmp$ export PS4='uuuu: '
pse@Mithos:~/.tmp$ bash -c "set -x; echo foo"
uuuu: echo foo
foo
0
17.04.2020, 09:08
0 ответов

Теги

Похожие вопросы