Sed 为什么';停止';图案不';你不能在我的命令下工作吗?

Sed 为什么';停止';图案不';你不能在我的命令下工作吗?,sed,Sed,我遵循了这个sed教程: 并编写以下命令来处理“python之禅”座右铭,如: sed '/Although/,/There/ s/a/A/g' zen Special cases aren't special enough to break the rules. Although prActicAlity beAts purity. Errors should never pAss silently. Unless explicitly silenced. In the fAce of Am

我遵循了这个sed教程:

并编写以下命令来处理“python之禅”座右铭,如:

sed '/Although/,/There/ s/a/A/g' zen

Special cases aren't special enough to break the rules.
Although prActicAlity beAts purity.
Errors should never pAss silently.
Unless explicitly silenced.
In the fAce of Ambiguity, refuse the temptAtion to guess.
There should be one-- And preferAbly only one --obvious wAy to do it.
Although thAt wAy mAy not be obvious At first unless you're Dutch.
Now is better thAn never.
似乎开始模式很好,但停止模式不起作用


如何修复它?

实际上,您的停止模式确实有效。但是嘿,你看:

Special cases aren't special enough to break the rules.
>>> Although <<< prActicAlity beAts purity.                       # Start
Errors should never pAss silently.
Unless explicitly silenced.
In the fAce of Ambiguity, refuse the temptAtion to guess.
>>> There <<< should be one-- And preferAbly only one        \
   --obvious wAy to do it.                                        # Stop
>>> Although <<< thAt wAy mAy not be obvious At first unless \
   you're Dutch.                                                  # Start again!
Now is better thAn never.
特殊情况不足以违反规则。

>>>虽然>那里>虽然你想做什么?@AvinashRaj,不起作用。我试图用包含“虽然”的行替换开始,直到行中有“那里”为止。你真是天才,有没有办法只打开一次/start/和/stop/标志?@JXG,但是你不打印文件的最后几行:/(我同意它应该可以用
-I
编辑文件)