diff octave-bug.in @ 5229:9b0ff1aefcbe

[project @ 2005-03-21 20:37:44 by jwe]
author jwe
date Mon, 21 Mar 2005 20:37:44 +0000
parents aa9bc151d2fa
children 9ecae85335fa
line wrap: on
line diff
--- a/octave-bug.in	Mon Mar 21 20:25:39 2005 +0000
+++ b/octave-bug.in	Mon Mar 21 20:37:44 2005 +0000
@@ -90,7 +90,30 @@
 
 : ${EDITOR=$DEFEDITOR}
 
-: ${PAGER=more}
+if [ -z "$DEFPAGER" ] && [ -z "$PAGER" ]; then
+  if [ -x /usr/bin/pager ]; then
+    DEFPAGER=pager
+  elif [ -x /usr/bin/less ]; then
+    DEFPAGER=less
+  elif [ -x /usr/bin/less ]; then
+    DEFPAGER=less
+  elif [ -x /usr/local/bin/less ]; then
+    DEFPAGER=less
+  elif [ -x /usr/bin/more ]; then
+    DEFPAGER=more
+  elif [ -x /bin/more ]; then
+    DEFPAGER=more
+  elif [ -x /usr/bin/pg ]; then
+    DEFPAGER=pg
+  elif [ -x /bin/pg ]; then
+    DEFPAGER=pg
+  else
+    echo "octave-bug: No default pager found: attempting to use more" >&2
+    DEFPAGER=more
+  fi
+fi
+
+: ${PAGER=$DEFPAGER}
 
 trap 'rm -f $TEMP $TEMP.x; exit 1' 1 2 3 13 15
 trap 'rm -f $TEMP $TEMP.x' 0