我echo -ne "hello\n"
使用bash和dash 使用相同的命令获得了不同的行为.见下文 :
$ bash -c 'echo -ne "hello\n"'
hello
$ dash -c 'echo -ne "hello\n"'
-ne hello
Run Code Online (Sandbox Code Playgroud)
这是为什么 ?我根本不明白......
我的系统:
$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 12.04.5 LTS
Release: 12.04
Codename: precise
Run Code Online (Sandbox Code Playgroud)