Wednesday, June 19, 2013

[Bash] text to html using vim built-in function TOhtml

#!/bin/bash
# convert a text file to html using vim built-in function TOhtml
# usage:
#            toHTML text-files
# http://scriptdemo.blogspot.com

if [ $# -eq 0 ]; then
   sed -n '3,4p' `which toHTML`
   exit
else
   for mytxt in $*
   do
      if [ -e ${mytxt} ]; then
         vim -c 'syntax on|TOhtml' -c 'wq|q!' ${mytxt}
      else
         echo "${mytxt} is not found"
      fi
   done
fi

ShowCalendar