Changeset 14af48c in clfs-embedded for BOOK


Ignore:
Timestamp:
Jul 15, 2007, 10:17:43 AM (17 years ago)
Author:
Manuel Canales Esparcia <manuel@…>
Branches:
master
Children:
c2f4c89
Parents:
eb56776
Message:

Updated obfuscate.sh

File:
1 edited

Legend:

Unmodified
Added
Removed
  • BOOK/obfuscate.sh

    reb56776 r14af48c  
    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.