dotfiles

*nix config files
git clone git://git.pyratebeard.net/dotfiles.git
Log | Files | Refs | README

htmldump (376B)


      1 #!/bin/sh
      2 
      3 usage() {
      4 	echo "usage: $(basename $0) [-c charset] file" >&2
      5 }
      6 
      7 while getopts 'c:h' OPT; do
      8 	case $OPT in
      9 		c) charset=$OPTARG ;;
     10 		h) usage; exit 0 ;;
     11 		*) usage; exit 1 ;;
     12 	esac
     13 done
     14 
     15 shift $((OPTIND -1))
     16 
     17 [ -z "$charset" ] && charset="$(file -i $1 | sed 's/.* charset=//')"
     18 iconv -f $charset -t utf-8 $1 \
     19 	| webdump -al \
     20 	| sed 'y/ / /;s/^\s*$//' \
     21 	| cat -s