From 18dea73f95d897bddc05942aa1544a7a21adb717 Mon Sep 17 00:00:00 2001 From: Oliver Kiddle Date: Tue, 6 Nov 2001 15:16:04 +0000 Subject: [PATCH] fix for IRIX --- ChangeLog | 4 ++ Functions/Misc/mere | 92 +++++++++++++++++++++++++++++++++++++++++++-- 2 files changed, 93 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 83bc43adf..df2de2bce 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2001-11-06 Oliver Kiddle + + * unposted: Functions/Misc/mere: fix for IRIX + 2001-10-26 Wayne Davison * 16184: Src/hist.c: Improved readhistline() to reject binary data diff --git a/Functions/Misc/mere b/Functions/Misc/mere index cf8d8ad14..410be9ab5 100644 --- a/Functions/Misc/mere +++ b/Functions/Misc/mere @@ -1,3 +1,89 @@ -#! /bin/sh -# read a man page in the current directory -nroff -man -Tman $1 | less -s +# read a man page + +setopt localoptions extendedglob + +local manual="$1" col=col terminal=man magic line + +# /usr/bin/col on SunOS 4 doesn't support -x. +if [[ -x /usr/5bin/col ]]; then + col=/usr/5bin/col; +fi + +# SunOS 5 has no `man' terminal. +if [[ -d /usr/share/lib/nterm && + ! -e /usr/share/lib/nterm/tab.$terminal ]]; then + terminal=lp; +fi + +# HP-UX has no `man' terminal. +if [[ -d /usr/share/lib/term && + ! -e /usr/share/lib/term/tab$terminal ]]; then + terminal=lp; +fi + +# IRIX has no `man' terminal. +if [[ -d /usr/lib/nterm && + ! -e /usr/lib/nterm/tab.$terminal ]]; then + terminal=lp; +fi + +# Unixware has no `man' terminal. +if [[ -d /usr/ucblib/doctools/nterm && + ! -e /usr/ucblib/doctools/nterm/tab.$terminal ]]; then + terminal=lp; +fi + +# Solaris has SGML manuals. +if [[ -f /usr/lib/sgml/sgml2roff ]] && + [[ "$(read -er < $manual)" = "