File: sensible-pager

package info (click to toggle)
sensible-utils 0.0.12
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 424 kB
  • sloc: sh: 715; makefile: 142; sed: 88
file content (17 lines) | stat: -rwxr-xr-x 433 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/bin/sh

# Prevent recursive loops, where these values are set to this script
p="$(which sensible-pager)"
[ "$(which $PAGER || true)" = "$p" ] && PAGER=

${PAGER:-pager} "$@"
ret="$?"
if [ "$ret" -eq 126 ] || [ "$ret" -eq 127 ]; then
more "$@"
ret="$?"
	if [ "$ret" -eq 126 ] || [ "$ret" -eq 127 ]; then
		echo "Couldn't find a pager!" 1>&2
		echo "Set the \$PAGER environment variable to your desired pager." 1>&2
		exit 1
	fi
fi