linux - 使用 Bash 删除特定标签

标签 linux bash

我想将我的博客从 WordPress 移动到 Pelican,但我一直无法使用自动脚本删除这些行?

[pro-player type="MP3"]http://domain/bla%20bla%20bla/a%20Lee%20yo%20-%20help.mp3[/pro-player]
[download id="79] 

我试过使用:

sed -e 's/[pro-player type="[]*"]\([^[]*\).*/\1/p' 

但运气不好。感谢您的帮助。

最佳答案

为了从文件中删除包含 [...] 的行,说:

sed '/^\[.*\]$/d' inputfile

这将删除以 [ 开头并以 ] 结尾的行。

关于linux - 使用 Bash 删除特定标签,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18693304/

相关文章:

node.js - BASH - 为什么我的 NodeJS 服务器脚本崩溃了?

bash - awk '{print $9}' 最后一个 ls -l 列,包括文件名中的任何空格

ios - 如何在运行某个方案时不运行脚本?

linux - 按bash中的字段比较文件

linux - 用于记录进程 ram 和 cpu 使用情况的小 sh 脚本

linux - 为什么 clang++ 的行为与 clang 不同,因为前者是后者的符号链接(symbolic link)?

c++ - Visual Studio C/C++ 如何与远程设备一起工作?

java - 如何在 eclipse 上配置 tomcat 6?

ruby-on-rails - 未定义的方法 : Activate Bin Path

bash - 在 shell 脚本中重新分配全局变量