#!/bin/rc # epub2txt - convert epub to text # usage: epub2txt file.epub # requires: # - epub2html # set some defaults rfork e if(! ~ $#* 1) exit usage keep=yes name=`{basename $1 | sed 's/\.[Ee][Pp][Uu][Bb]//'} if(! test -f $name.html){ keep=no epub2html $* || exit $status } ifs=' ' # convert extracted epub to text >$name.txt for(file in `{awk -F" '/>$name.txt if(~ $keep no) rm -rf $name.html $name^_files