我有一個包含替換文本
<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