Remove/replace html tags in bash

后端 未结 2 1574
梦毁少年i
梦毁少年i 2021-01-02 08:30

I have a file with lines that contain:

  • Some Text: More Text
  • I want to remove the html tags and r

    2条回答
    •  一整个雨季
      2021-01-02 09:06

      One way using GNU sed:

      sed -e 's/<\/b>/-/g' -e 's/<[^>]*>//g' file.txt
      

      Example:

      echo "
    • Some Text: More Text
    • " | sed -e 's/<\/b>/-/g' -e 's/<[^>]*>//g'

      Result:

       Some Text:- More Text
      

    提交回复
    热议问题