我不明白商店xpg_echo
在激活或停用时会发生什么变化。
在手册中:
xpg_echo
If set, the echo builtin expands backslash-escape
sequences by default.
我尝试激活/停用xpg_echo,但echo具有相同的行为。
答案 0 :(得分:2)
它确定echo是否会处理像\n
这样的转义序列:
$ shopt -u xpg_echo # Disable xpg_echo
$ echo "Hello\nworld"
Hello\nworld
$ shopt -s xpg_echo # Enable xpg_echo
$ echo "Hello\nworld"
Hello
world