aboutsummaryrefslogtreecommitdiff
path: root/bin/pst.sh
diff options
context:
space:
mode:
Diffstat (limited to 'bin/pst.sh')
-rw-r--r--bin/pst.sh32
1 files changed, 0 insertions, 32 deletions
diff --git a/bin/pst.sh b/bin/pst.sh
deleted file mode 100644
index fdea9884..00000000
--- a/bin/pst.sh
+++ /dev/null
@@ -1,32 +0,0 @@
-#!/bin/sh
-# Interrupt a pipe with manual /dev/tty input to a program
-self=pst
-
-# Don't accept terminal as stdin
-if [ -t 0 ] ; then
- printf >&2 '%s: stdin is a term\n' "$self"
- exit 2
-fi
-
-# Create a temporary directory with name in $td, and handle POSIX-ish traps to
-# remove it when the script exits.
-td=
-cleanup() {
- [ -n "$td" ] && rm -fr -- "$td"
- if [ "$1" != EXIT ] ; then
- trap - "$1"
- kill "-$1" "$$"
- fi
-}
-for sig in EXIT HUP INT TERM ; do
- # shellcheck disable=SC2064
- trap "cleanup $sig" "$sig"
-done
-td=$(mktd "$self") || exit
-
-# Run the interactive command on the temporary file forcing /dev/tty as
-# input/output
-tf=$td/data
-cat - > "$tf" || exit
-"${@:-"${PAGER:-more}"}" "$tf" </dev/tty >/dev/tty
-cat -- "$tf" || exit