- Timestamp:
- Jul 28, 2007, 3:11:21 AM (17 years ago)
- Branches:
- clfs-1.2, clfs-2.1, clfs-3.0.0-systemd, clfs-3.0.0-sysvinit, master, systemd, sysvinit
- Children:
- 2baa4a3
- Parents:
- f8c4e94
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
BOOK/obfuscate.sh
rf8c4e94 rff103efa 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.