输出多行文本到文件中去

+239@~> echo "
test
`whoami`
haha
">outfile
+239@~> cat outfile 

test
wang
haha

但是里面如果出现引号之类的,比较难处理 可以用heredoc:

+239@~> cat > outfile < just a test 
> "`whoami`"
> haha'aa
> EOF
+239@~> cat outfile 
just a test 
"wang"
haha'aa