我是UNIX新手。如何将“the”的下一个单词替换为“there”?
我知道s/\<the\>/there/
可以取代第一次出现的&#34;&#34;在线。教科书上写着:n – search forward for the next occurrence of the text searched previously.
但是在哪里放&#34; n&#34;?
答案 0 :(得分:0)
将数字放在最后,您期望g
:
echo "This is the test of replacing the third word the by there" | sed 's/\<the\>/there/3'
This is the test of replacing the third word there by there