我想在特定的行之间插入#ifdef和#endif,例如-
FunctionXYZ(******);
应该成为
#ifdef X
FunctionXYZ(*****); //*****can be anything
#endif
在目录和子目录中的所有文件中。
为此有一个linux命令吗?
find ./ -type f -exec sed -i '/FUNCTIONXYZ/i NEWLINE' {} \; -> above
find ./ -type f -exec sed -i '/FUNCTIONXYZ/a NEWLINE' {} \; -> below
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句