aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Ankarström <john@ankarstrom.se>2021-06-08 18:08:33 +0200
committerJohn Ankarström <john@ankarstrom.se>2021-06-08 18:08:33 +0200
commitdb378a556fe17d546501573ada3f2a416d0ee7fd (patch)
tree5b0fc338e23bb0cc3c973c9395a05edf5b1c7708
parent78582b12232810e1221e746f2c439a54019154fc (diff)
downloadxutil-db378a556fe17d546501573ada3f2a416d0ee7fd.tar.gz
Add 'p' and 'P' utilities
-rwxr-xr-xP5
-rwxr-xr-xp7
2 files changed, 12 insertions, 0 deletions
diff --git a/P b/P
new file mode 100755
index 0000000..3c11b20
--- /dev/null
+++ b/P
@@ -0,0 +1,5 @@
+#!/bin/sh
+
+# P -- open file processed with p in PAGER
+
+"$PAGER" /var/tmp/pg
diff --git a/p b/p
new file mode 100755
index 0000000..fa6db76
--- /dev/null
+++ b/p
@@ -0,0 +1,7 @@
+#!/bin/sh
+
+# p -- maybe view command output in pager
+
+[ -t 0 ] && exec /bin/sh -c '"$@" | "$0"' "$0" "$@"
+
+cat | tee /var/tmp/pg