Невозможно отключить подкачку

Одно из изменений между bash -4.3 -alpha и предыдущей версией, выпуском bash -4.2 -:

When using the pattern substitution word expansion, bash now runs the replacement string through quote removal, since it allows quotes in that string to act as escape characters. This is not backwards compatible, so it can be disabled by setting the bash compatibility mode to 4.2.


Вход:

BASH_COMPAT=4.2
line="a'b"
echo "${line//\'/''}"

Выход:

a''b

2
21.10.2021, 09:34
0 ответов

Теги

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