From 0053948a95d09f7e20b40e5ab643dfa580f45375 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Fri, 10 Nov 2017 23:49:20 +1300 Subject: Fix oii(1df) so it works as a pipe I realised I could make this work by recording a single byte in the temporary file with dd(1) and then emitting that and then the rest of the input with cat(1) if the file ended up with a byte in it. This lets me remove the CAVEATS section from the manual, as it no longer applies. --- man/man1/oii.1df | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'man') diff --git a/man/man1/oii.1df b/man/man1/oii.1df index f5bb2678..6d1cf601 100644 --- a/man/man1/oii.1df +++ b/man/man1/oii.1df @@ -1,4 +1,4 @@ -.TH OII 1df "June 2017" "Manual page for oii" +.TH OII 1df "November 2017" "Manual page for oii" .SH NAME .B oii \- run a command on input only if there's at least one byte of input @@ -13,9 +13,5 @@ CMD [ARGS ...] Run the given program passing in stdin but only if at least one byte of input is actually received, rather like the -E switch to mail(1) behaves on bsd-mailx. If no input is received, exit silently with an error status. -.SH CAVEATS -It's slow, and doesn't work as a pipe. The entire input is written to disk and -then tested for filesize before being re-emitted. There's almost certainly a -more efficient way to do this while still remaining byte-safe. .SH AUTHOR Tom Ryder -- cgit v1.2.3