Last active
August 29, 2015 14:02
-
-
Save omas/9b2468d24750e13433ef to your computer and use it in GitHub Desktop.
html の タグを除去
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
cat $1 \ | |
| sed -e "s/\r//g" \ | |
| tr "\n" "@" \ | |
| sed -e "s/<script>[^<]*<\/script>//g" \ | |
| sed -e "s/<style>[^<]*<\/style>//g" \ | |
| sed -e "s/<!--[^<]*-->//g" \ | |
| sed -e "s/ //g" \ | |
| sed -e "s/>/>/g" \ | |
| sed -e "s/</</g" \ | |
| sed -e "s/<[^>]*>//g" \ | |
| sed -e "s/[ \t]*//g" \ | |
| sed -e "s/@@*/@/g" \ | |
| tr "@" "\n" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
html のタグと空白を削除