关于gvim的操作
时间:10-02
整理:3721RD
点击:
请问,在linux下,一个目录下有8个文件,每个文件的第10行都是一样的内容,是:read_verilog,我现在想一次性给这8个文件中的第10行前面加上个#,变成:#read_verilog应该怎么做?如何一次性搞定?
It should be very easy in perl script:1) work out a file list in the hold
2) foreach loop working every line for all the files in 1), counting the line #
3) contents in line of 2) write out intact, except line 10
4) for line 10, write out "#", then the line 10 content
sed -i '10s/^/#/' *
小心这会不给任何提示地直接修改原文件。
