So, why use it instead of sed?
那么,为什么要使用tr,而不使用sed呢?
Listing 20. Beginning sed scripts.
清单20.sed脚本。
Complex search and replace with sed.
使用sed进行复杂的搜索和替换。
Listing 2. Matched strings marked in sed.
清单2.sed中标记的匹配字符串。
Listing 20 shows three simple sed scripts.
清单20展示了三个简单的sed脚本。
Uncompressing sed into a temporary directory.
将sed解压缩到临时目录。
This will cause sed to delete any matching lines.
这将导致sed删除任何匹配的行。
There are ways to do this with grep, sed, and perl.
可以通过使用 grep、sed和 perl完成此工作。
You will also learn how to use the stream editor sed.
您还将了解到如何使用流编辑器sed。
Let's now do that with a sed script stored in a file.
现在让我们使用存储在文件中的sed脚本来实现相同的操作。
Why not take some time to install GNU sed 3.02.80 now?
现在为什么不花些时间安装GNUsed 3.02.80呢?
A set of sed commands is usually called a sed script.
sed命令集常常被称为sed脚本。
The second thing to notice is that sed is line-oriented.
第二件要注意的事是sed 是面向行的。
Every Linux distribution has GNU sed, or at least should.
每一个Linux发行版都有(或至少应该有)GNUsed。
You can see the basic format of a sed command in Listing 7.
在清单7中,您可以看到sed命令的基本格式。
Start txt2regex and specify regexps for grep, sed, and emacs.
启动txt2regex并指定构建用于grep、sed和Emacs的regexp。
Using the editor sed to script complex changes to text files.
使用编辑器sed编写脚本,对文本文件做出复杂的修改。
You can also write a short sed program to output matches in color.
还可以编写简短的sed程序来以颜色标记输出内容。
After getting GNU sed 3.02.80 installed, I was finally ready to go.
安装完gnused3.02.80之后,我就完全准备好了。
You'll notice that sed performs its desired task with flying colors.
您将注意到,sed 成功完成了预期任务。
Sed is line-based, so the commands are performed on each line in order.
sed是基于行的,因此按顺序对每一行执行命令。
You can also alter text from the command line using patterns, replace, and sed.
还可以使用模式、替换和sed从命令行更改文本。
You can also do regexp highlighting in sed, the stream editor. The sed command.
还可以在sed(流编辑器,stream editor)中进行regexp突出显示。
This is simply a special keyword that tells sed to match either a TAB or a space.
这只是一个特殊的关键字,它告诉sed与TAB或空格匹配。
In addition to operating on individual lines, sed can operate on a range of lines.
除了操作单独的行外,sed还可以操作一个行范围。
You had used regexps for egrep, sed, and perl; now try building it for plain grep.
前面已经使用了适用于egrep、sed和perl的regexp,现在我们将尝试构建适用于普通grep的regexp。
The most complex and powerful of editing tools discussed here is sed (Stream EDitor).
本文讨论的最复杂和最强大的编辑工具是sed(流编辑器)。
The 'd' command didn't simply tell sed to delete all incoming data in one fell swoop.
d'命令不是简单地告诉sed 一下子删除所有输入数据。
There are many handy sed one-liners such as Listing 22. See Resources for links to some.
还有许多像清单22这样方便的sed单行脚本。参见参考资料获得其中一些脚本的链接。
应用推荐