- Timestamp:
- Jul 15, 2007, 10:17:43 AM (17 years ago)
- Branches:
- master
- Children:
- c2f4c89
- Parents:
- eb56776
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
BOOK/obfuscate.sh
reb56776 r14af48c 4 4 # obfuscate email addresses in XML/HTML 5 5 # Script written (and slight perl modification) by Archaic <archaic AT linuxfromscratch D0T org> 6 # Modified from "sed -i" to old style "sed -e" by Manuel Canales <manuel AT linuxfromscratch D0T org> 7 # to prevent hangs on very long files, like nonckunked books. 6 8 # Original Perl expression by Anderson Lizardo <lizardo AT linuxfromscratch D0T org> 7 9 # Released under the GNU General Public License … … 26 28 #cp "$1" "$1".bak 27 29 28 for i in `grep -o '"mailto:.*@.*"' "$1"|sed -e 's|^"mailto:||' -e 's|"$||'`; do30 for i in `grep -o '"mailto:.*@.*"' ${1} |sed -e 's|^"mailto:||' -e 's|"$||'`; do 29 31 link=`echo $i | perl -pe 's/[^\n]/"\\\&#".ord($&)."\;"/ge'` 30 32 plaintext=`echo $i | sed -e 's|@| AT |' -e 's|\.| D0T |g'` 31 sed -i "s|mailto:$i|mailto:$link|" "$1" 32 sed -i "s|$i|$plaintext|" "$1" 33 cp ${1}{,.tmp} 34 sed -e "s|mailto:$i|mailto:$link|" \ 35 -e "s|$i|$plaintext|" ${1}.tmp > ${1} 36 rm ${1}.tmp 33 37 done 34 38 #rm $FILE.tmp 35 39 #exit 0
Note:
See TracChangeset
for help on using the changeset viewer.