我的问题是在sed的帮助下每出现一次包含子字符串“two”的单词,但不要加倍单词“两节”本身sed命令将每个出现的包含子字符串但不是双字本身的单词翻倍的次数
我迄今为止尝试:
cat filename | sed 's/ \ (two\) /\1\1/g'
但我的问题是,它是重复的词本身。
例如:
two times twothird threetwothree
执行上述sed的操作是什么我之后是:
twotwo times twotwothird threetwotwothree
但我打算到这里是:
two times twothird twothird threetwothree threetwothree
任何人有任何想法如何解决这个问题?
它的/ \(二但stackoverflow只是显示/(由于某种原因 – Lucifellow