1

dash中

echo 'hello\nworld'

将会输出

hello
world

2

bash中

echo 'hello\nworld'

将会输出

hello\nworld

一般情况下 /bin/sh 被软链到 /bin/dash,偶尔也会遇到有人把 /bin/sh 软链到 /bin/bash。就会出现结果与预期不符的情况。

/bin/echo -e 'hello\nworld'

可以解决上述问题

bash支持的语法更多,建议用bash。dash更轻量级。

相关文章:

  • 2021-11-29
  • 2021-07-21
  • 2021-10-29
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-05-17
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-01-11
相关资源
相似解决方案