Changeset f1f6d91 in clfs-sysroot for BOOK/obfuscate.sh


Ignore:
Timestamp:
Jul 21, 2007, 8:19:58 AM (17 years ago)
Author:
Manuel Canales Esparcia <manuel@…>
Branches:
master
Children:
7c1c987
Parents:
3a074a4
Message:

Updated obfuscate.sh.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • BOOK/obfuscate.sh

    r3a074a4 rf1f6d91  
    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.