我有格式的文件:Linux文本文件操作
<a href="http://www.wowhead.com/?search=Superior Mana Oil">
<a href="http://www.wowhead.com/?search=Tabard of Brute Force">
<a href="http://www.wowhead.com/?search=Tabard of the Wyrmrest Accord">
<a href="http://www.wowhead.com/?search=Tattered Hexcloth Sack">
我需要选择=之后,但在“,并在该行的末尾打印此之前的文本,将因此成为例如:
<a href="http://www.wowhead.com/?search=Superior Mana Oil">Superior Mana Oil</a>
<a href="http://www.wowhead.com/?search=Tabard of Brute Force">Tabard of Brute Force</a>
<a href="http://www.wowhead.com/?search=Tabard of the Wyrmrest Accord">Tabard of the Wyrmrest Accord</a>
<a href="http://www.wowhead.com/?search=Tattered Hexcloth Sack">Tattered Hexcloth Sack</a>
我不知道的通过Linux命令行来做到这一点(我猜大概SED/AWK但不与他们良好)的最佳方式,在理想情况下就像一个剧本,我可以只给文件名例如./fixlink.sh brokenlinks.txt
尝试编写脚本并运行它。何时/如果您遇到错误,请将其发布到此处并提供帮助。 “请为我写脚本”类型的问题在这里不是很受鼓励。 – 2010-01-20 11:41:24