sthen 18b5d4007a Adjust txt2man's bookman script to avoid "[[ $i ]] || ...", /bin/sh doesn't
like this at all. This is an alternative to a diff proposed by Charles A Daniels
that moved txt2man to using bash.
2018-12-12 22:58:57 +00:00

29 lines
698 B
Plaintext

$OpenBSD: patch-bookman,v 1.2 2018/12/12 22:58:57 sthen Exp $
GNUism.
Index: bookman
--- bookman.orig
+++ bookman
@@ -83,9 +83,9 @@ done
shift $(($OPTIND - 1))
date=${date:-$(date +'%d %B %Y')}
-[[ $1 ]] || set -- $(while read; do echo $REPLY; done)
+[[ -n $1 ]] || set -- $(while read; do echo $REPLY; done)
-[[ $outfile ]] && post="$post >$outfile"
+[[ -n $outfile ]] && post="$post >$outfile"
{
# Compute table of content from postscript output.
@@ -127,7 +127,7 @@ date=${date:-$(date +'%d %B %Y')}
name = $0
}
END {print ".XE"; print ".PX"}'
- } | groff -Z -ms | head --lines=-1
+ } | groff -Z -ms | sed '$d'
# Output content, in gtroff intermediate format.
for f