我想使用以下内容将一些预定义的文本写入文件:
text="this is line one\n
this is line two\n
this is line three"
echo -e $text > filename
Run Code Online (Sandbox Code Playgroud)
我期待这样的事情:
this is line one
this is line two
this is line three
Run Code Online (Sandbox Code Playgroud)
但得到了这个:
this is line one
this is line two
this is line three
Run Code Online (Sandbox Code Playgroud)
我很肯定每个人都没有空间\n,但额外的空间是如何产生的?