IsraelTorres icon

w3cgoog.sh

IsraelTorres | PRO | 04/15/12 06:36:27 PM UTC | 0 ⭐ | 304 👁️ | Never ⏰ | []
Bash |

790 B

|

None

|

0 👍

/

0 👎

#!/bin/bash
:<<israeltorres_comment_block
 
./w3cgoog.sh
Israel Torres
2012-04-15
modify google docs exported html to be w3c compliant to stdout
 
Mac OS X 10.7.3 11D50d 
Darwin Kernel Version 11.3.0
GNU bash, version 3.2.48(1)-release 
 
israeltorres_comment_block
 
#required app check
rqdapp='sed'
hash $rqdapp 2>&- || { echo >&2 "$rqdapp binary not found - aborting"; exit 1; }
#
 
if [ ! $# -ne 1 ]; then
WEBFILE=$1
TEMPLATE1='<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">'
TEMPLATE2='\<html\>\<head\>'
TEMPLATE3='<meta http-equiv="Content-Type" content="text\/html; charset=utf-8">'
echo -n "$TEMPLATE1" | cat - $WEBFILE | sed "s/$TEMPLATE2/$TEMPLATE2$TEMPLATE3/"
 
else
echo "usage: $0 'google-exported-file.html'"
echo "example: $0 google-exported-file.html"
fi
#eof

Comments

  •  icon
    01/01/70 12:00:00 AM UTC
    Plain Text |

    0 B

    |

    👍

    /

    👎