0

我正在使用leanpub.com 并导入了我的博客,但不小心让它导入图像。我不希望这样,所以现在我想从大约 2,000 个单独的标记文件中删除图像。如果您熟悉降价,您会知道图像是这样指定的

![optional alt text](url/link "optional title")

更新:经过进一步检查,一些图像也是链接,因此它们的包含如下:

[![alt text](image link "title text")](url image links to)

示例文本

[![Hollywood: An Empire of Their Own (A&E DVD Archives)](images/51EEVBAA32L._SL160_.jpg)Hollywood: An Empire of Their Own (A&E DVD Archives)](http://www.amazon.com/Hollywood-Empire-Their-Own-Archives/dp/B0009HMTEO?SubscriptionId=08NDXT4K5C4JPKBB4702&tag=amz&linkCode=xm2&camp=2025&creative=165953&creativeASIN=B0009HMTEO)This 
"lucid, inviting work of social history" (The New York Times) highlights the 
bold and enduring vision of the Jewish immigrants who founded Hollywood and reinvented American culture.
4

1 回答 1

0

只需去掉标记![). 请注意,可选的尾随空格很重要,因为链接可以被其他文本包围。

sed --in-place='.bak' 's/!\[.*)[[:space:]]\?//' [file ...]
于 2012-05-13T20:43:38.130 回答