From a9e25e51ca3c96d3b5bfc86ab5a45c5bee818152 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Thu, 29 Jun 2017 17:46:34 +1200 Subject: Add oii(1df) --- bin/oii.mi5 | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 bin/oii.mi5 (limited to 'bin') diff --git a/bin/oii.mi5 b/bin/oii.mi5 new file mode 100644 index 00000000..51f37fb4 --- /dev/null +++ b/bin/oii.mi5 @@ -0,0 +1,19 @@ +# Only run a command on input if there was at least one byte +self=oii + +# Need at least a command name +if [ "$#" -eq 0 ] ; then + printf >&2 '%s: Need a command\n' "$self" + exit 2 +fi + +<% +include(`include/mktd.m4') +%> + +# There is probably a way better way to do this than writing the whole file to +# disk and then reading it off again, but until I think of something better, +# this works and is byte-safe. +cat - > "$td"/in +[ -s "$td"/in ] || exit +"$@" < "$td"/in -- cgit v1.2.3