【发布时间】:2014-03-19 04:55:20
【问题描述】:
我有大约 30,000 个文件,每个文件大小为 5MB。我想在每个文件的top 上附加几行。我已经使用 bash 脚本完成了这项工作。我想学习一种使用 perl 的方法。
【问题讨论】:
-
如何找到这些文件?它们是在单个目录中,还是散布在整个文件系统中?
-
在单个目录中。我有一个名为
list的文件中的名称列表 -
来自 SO:
append a text on the top of the file,2011 年 5 月 26 日。或How do I add lines to the top and bottom of a file in Perl?从 09 年 8 月 5 日开始。来自 Perldoc:How do I change, delete, or insert a line in a file, or append to the beginning of a file?
标签: perl