Changeset 05d60ce for obfuscate.sh


Ignore:
Timestamp:
07/06/2007 05:54:18 PM (17 years ago)
Author:
Manuel Canales Esparcia <manuel@…>
Branches:
10.0, 10.0-rc1, 10.1, 10.1-rc1, 11.0, 11.0-rc1, 11.0-rc2, 11.0-rc3, 11.1, 11.1-rc1, 11.2, 11.2-rc1, 11.3, 11.3-rc1, 12.0, 12.0-rc1, 12.1, 12.1-rc1, 6.3, 6.4, 6.5, 6.6, 6.7, 6.8, 7.0, 7.1, 7.2, 7.3, 7.4, 7.5, 7.5-systemd, 7.6, 7.6-systemd, 7.7, 7.7-systemd, 7.8, 7.8-systemd, 7.9, 7.9-systemd, 8.0, 8.1, 8.2, 8.3, 8.4, 9.0, 9.1, arm, bdubbs/gcc13, ml-11.0, multilib, renodr/libudev-from-systemd, s6-init, trunk, xry111/arm64, xry111/arm64-12.0, xry111/clfs-ng, xry111/lfs-next, xry111/loongarch, xry111/loongarch-12.0, xry111/loongarch-12.1, xry111/mips64el, xry111/pip3, xry111/rust-wip-20221008, xry111/update-glibc
Children:
6dd1a9f
Parents:
0e6d3c0
Message:

Added a versose flag and other fixes to the Makefile.
Changed obfuscate.sh to try to prevent hangs when parsing nonchunked output.

git-svn-id: http://svn.linuxfromscratch.org/LFS/trunk/BOOK@8203 4aa44e1e-78dd-0310-a6d2-fbcd4c07a689

File:
1 edited

Legend:

Unmodified
Added
Removed
  • obfuscate.sh

    r0e6d3c0 r05d60ce  
    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.