Changeset ff103efa


Ignore:
Timestamp:
Jul 28, 2007, 10:11:21 AM (17 years ago)
Author:
Manuel Canales Esparcia <manuel@…>
Branches:
clfs-1.2, clfs-2.1, clfs-3.0.0-systemd, clfs-3.0.0-sysvinit, master, systemd, sysvinit
Children:
2baa4a3
Parents:
f8c4e94
Message:

Updated obfuscate.sh.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • BOOK/obfuscate.sh

    rf8c4e94 rff103efa  
    44# obfuscate email addresses in XML/HTML
    55# 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.
    68# Original Perl expression by Anderson Lizardo <lizardo AT linuxfromscratch D0T org>
    79# Released under the GNU General Public License
     
    2628#cp "$1" "$1".bak
    2729
    28 for i in `grep -o '"mailto:.*@.*"' "$1" |sed -e 's|^"mailto:||' -e 's|"$||'`; do
     30for i in `grep -o '"mailto:.*@.*"' ${1} |sed -e 's|^"mailto:||' -e 's|"$||'`; do
    2931  link=`echo $i | perl -pe 's/[^\n]/"\\\&#".ord($&)."\;"/ge'`
    3032  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
    3337done
    34 
     38#rm $FILE.tmp
    3539#exit 0
Note: See TracChangeset for help on using the changeset viewer.