我有一个包含替换文本
<this can be anything, any number of line - no hardcoded>
<this can be anything, any number of line - no hardcoded>
param1=<this can be any value - no hardcoded>
<this can be anything, any number of line - no hardcoded>
<this can be anything, any number of line - no hardcoded>
text1.txt我想更换这部分这可以是任何值 - 没有硬编码与ABC
应该是什么是正确的SED命令? 请注意,由于环境限制,我不能灵活地使用任何语言,如perl,python或ruby〜,只能使用Unix命令。 除了之外没有硬编码参数1
非常感谢!
[这太问题(http://stackoverflow.com/questions/1074450/sed替换部分)可能会有所帮助。 – 2012-04-10 08:25:17
评论中的所有样本值如何? – 2012-04-10 08:34:11
@shiplu你能否澄清一下构成注释的内容,按照OP的问题'text1.txt'是一个普通的文本文件,所以任何东西都可以表示注释? – beny23 2012-04-10 08:37:30