Forgot password?
 Create new account
View 123|Reply 0

sed

[Copy link]

3151

Threads

8498

Posts

610K

Credits

Credits
66208
QQ

Show all posts

hbghlyj Posted at 2022-6-24 02:28:06 |Read mode
gnu.org/software/sed/manual/sed.html
Example
  1. find ./ -type f -exec sed -i 's/ul class="litype_1" type="1"/ol/g' {} \;
Copy the Code

QQ图片20220401132641.png
replace all <ul type="1" class="litype_1"> tags (typically, html produced by Discuz) in current directory to <ol>
Currently I don't find a way to replace those matching end tags </ul> to </ol>(maybe need a xml parser)
but it should be fine in most cases (browsers fix tags automatically )

手机版Mobile version|Leisure Math Forum

2025-4-21 14:27 GMT+8

Powered by Discuz!

× Quick Reply To Top Return to the list