diff options
author | Manuel Canales Esparcia <manuel@linuxfromscratch.org> | 2007-07-06 17:54:18 +0000 |
---|---|---|
committer | Manuel Canales Esparcia <manuel@linuxfromscratch.org> | 2007-07-06 17:54:18 +0000 |
commit | 05d60cedcd5f27ae095e16e8ffd9534d064eb960 (patch) | |
tree | 7b73459cec358456f501b992d79b8f6d3d56e9ee /obfuscate.sh | |
parent | 0e6d3c0b4561bc227518f58887266f048bd68bad (diff) |
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
Diffstat (limited to 'obfuscate.sh')
-rw-r--r-- | obfuscate.sh | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/obfuscate.sh b/obfuscate.sh index 0e9f8f8fe..dd2bf24d2 100644 --- a/obfuscate.sh +++ b/obfuscate.sh @@ -3,6 +3,8 @@ # obfuscate.sh # obfuscate email addresses in XML/HTML # Script written (and slight perl modification) by Archaic <archaic AT linuxfromscratch D0T org> +# Modified from "sed -i" to old style "sed -e" by Manuel Canales <manuel AT linuxfromscratch D0T org> +# to prevent hangs on very long files, like nonckunked books. # Original Perl expression by Anderson Lizardo <lizardo AT linuxfromscratch D0T org> # Released under the GNU General Public License # @@ -25,11 +27,13 @@ # Nothing like a backup plan! #cp "$1" "$1".bak -for i in `grep -o '"mailto:.*@.*"' "$1" |sed -e 's|^"mailto:||' -e 's|"$||'`; do +for i in `grep -o '"mailto:.*@.*"' ${1} |sed -e 's|^"mailto:||' -e 's|"$||'`; do link=`echo $i | perl -pe 's/[^\n]/"\\\&#".ord($&)."\;"/ge'` plaintext=`echo $i | sed -e 's|@| AT |' -e 's|\.| D0T |g'` - sed -i "s|mailto:$i|mailto:$link|" "$1" - sed -i "s|$i|$plaintext|" "$1" + cp ${1}{,.tmp} + sed -e "s|mailto:$i|mailto:$link|" \ + -e "s|$i|$plaintext|" ${1}.tmp > ${1} + rm ${1}.tmp done - +#rm $FILE.tmp #exit 0 |