2 # minimalistic replacement for `run-mailcap --action=cat <file>`
4 if test "$#" != 1 ; then
5 echo "Usage: astextplain <file>" 1>&2
9 # small files are never .doc or .pdf -- they are unsupported-on-win32 symlinks
10 # which git just stores as regular files with symlink content
11 if test $
(du
-b "$1" |
awk '{print $1}') -lt 256 ; then
17 # XXX output encoding (UTF-8) hardcoded
19 *.doc |
*.DOC |
*.dot |
*.DOT
)
20 antiword
-m UTF-8
"$1" ||
cat "$1"
26 pdftotext
-layout "$1" -enc UTF-8
-
28 # TODO add rtf support
33 echo "E: unsupported filetype $1" 1>&2