Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
当变量包含命令的输出时,使用 echo 打印此变量会抑制新行。转义反斜杠echo -e不起作用。设置SHELL变量也无济于事。
echo -e
SHELL
例子 :
$ cat log1.txt terminated terminator $ gmake terminated terminator
使用以下生成文件:
all: @ab=`cat log1.txt`;\ echo -e $$ab
生成文件版本:GNU Make 3.82
绝对是外壳问题。shell 脚本中的相同代码也不起作用。