commit - 829ec0d30c5a298739be7f3f97ff7472b7ee1b27
commit + 72208f38277ad8aa8f1e9c13d5fc266d64474eb7
blob - 8b85e5599d5727cb2b57858509b227183349e5dc
blob + e38b6dd6b0b74abcc8545450f05f8c913ed8b9c2
--- bin/page
+++ bin/page
end tell' | osascript
}
+xfile()
+{
+ if sed 1q "$1" | 9 grep '^x T '
+ then
+ echo 'troff intermediate output'
+ else
+ file - < "$1"
+ fi
+}
+
main()
{
case `uname` in
preview "$@"
;;
*)
- case "`file $1`" in
+ case "`xfile $1`" in
+ *troff*)
+ tr2post "$1" | psfonts | page
+ ;;
*PDF*)
psv $1
;;
0)
tmp=/var/tmp/page.$$.tmp
cat >$tmp
- case "`file $tmp`" in
+ case "`xfile $tmp`" in
+ *troff*)
+ mv $tmp $tmp.tr
+ tmp=$tmp.tr
+ ;;
*PDF*)
mv $tmp $tmp.pdf
tmp=$tmp.pdf