--- txt2man-1.5.5.orig/bookman
+++ txt2man-1.5.5/bookman
@@ -83,16 +83,16 @@
 shift $(($OPTIND - 1))
 date=${date:-$(date +'%d %B %Y')}
 
-[[ $1 ]] || set -- $(while read; do echo $REPLY; done)
+[ $1 ] || set -- $(while read REPLY; do echo $REPLY; done)
 
-[[ $outfile ]] && post="$post >$outfile"
+[ $outfile ] && post="$post >$outfile"
 
 {
 	# Compute table of content from postscript output.
 	# Generate output in gtroff intermediate format, so
 	# it can be merged with content.
 	{
-		[[ -f $cover ]] && cat $cover || {
+		[ -f $cover ] && cat $cover || {
 			printf ".af %% i\n.P1\n"
 			printf ".OH ||%s||\n" "$volume"
 			printf ".EH ||%s||\n" "$volume"
--- txt2man-1.5.5.orig/txt2man
+++ txt2man-1.5.5/txt2man
@@ -140,11 +140,12 @@
 	p) doprobe=1;;
 	I) itxt="$OPTARG§$itxt";;
 	B) btxt=$OPTARG;;
-	T) post="groff -mandoc -Tlatin1 | ${PAGER:-more}";;
+	T) post="groff -mandoc -Tlatin1 | ${PAGER:-pager}";;
 	X) post="groff -mandoc -X";;
 	*) usage; exit;;
 	esac
 done
+echo $post > /tmp/2222
 shift $(($OPTIND - 1))
 date=${date:-$(date +'%d %B %Y')}
 
@@ -163,7 +164,7 @@
 	rel=$(pwd | sed 's:/.*[^0-9]/::g; s:/.*::g')
 fi
 
-head=".\\\" Text automatically generated by txt2man
+head="\"Text automatically generated by txt2man
 .TH $title $section \"$date\" \"$rel\" \"$volume\""
 
 # All tabs converted to spaces
@@ -171,7 +172,7 @@
 # gawk is needed because use of non standard regexp
 gawk --re-interval -v head="$head" -v itxt="$itxt" -v btxt="$btxt" '
 BEGIN {
-	print head
+	print ".\\"head
 	avar[1] = btxt; avar[2] = itxt
 	for (k in avar) {
 		mark = (k == 1) ? "\\fB" : "\\fI"
@@ -187,7 +188,7 @@
 }
 {
 	# to avoid some side effects in regexp
-	sub(/\.\.\./, "\\.\\.\\.")
+	gsub(/\.\.\./, "\\.\\.\\.")
 	# remove spaces in empty lines
 	sub(/^ +$/,"")
 }
