Last active
January 2, 2016 23:58
-
-
Save coderofsalvation/8379355 to your computer and use it in GitHub Desktop.
converts special htmlcharacters into htmlentities
This file contains hidden or 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
| # converts special htmlcharacters into htmlentities | |
| # usage: cat file.txt | htmlentities | |
| htmlentities(){ | |
| cat - | sed -e 's/&/\&/g' \ | |
| -e 's/</\</g' \ | |
| -e 's/>/\>/g' \ | |
| -e 's/ä/\ä/g' \ | |
| -e 's/ö/\ö/g' \ | |
| -e 's/ü/\ü/g' \ | |
| -e 's/ß/\ß/g' \ | |
| -e 's/Ä/\Ä/g' \ | |
| -e 's/Ö/\Ö/g' \ | |
| -e 's/Ü/\Ü/g' | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment