【发布时间】:2016-05-27 04:51:11
【问题描述】:
我们如何将给定目录中所有文件的所有内容复制到一个文件中以便每个文件的内容之间有两个空行?
不用说,我是 bash 脚本的新手,我知道这不是一个特别复杂的代码!
任何帮助将不胜感激。
相关链接如下:
* How do I compare the contents of all the files in a directory against another directory?
* Append contents of one file into another
* BASH: Copy all files and directories into another directory in the same parent directory
看完cmets,我最初的尝试是这样的:
cat * > newfile.txt
但这不会在每个新文件的内容之间创建两个空行。
【问题讨论】:
-
cat是你的朋友,请阅读手册页。 -
cat * > newfile.txt.. -
你能解释为什么你回滚我的标题编辑吗?您将继续收到带有当前标题的
cat *答案。 -
@tripleee 我尝试更正多余的空格,如果您再次编辑问题,我们将非常欢迎!
-
@tripleee 删除重复的问题更好,或者我能做什么?