<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, 8 Apr 2020 at 15:55, Anand Buddhdev <<a href="mailto:anandb@ripe.net">anandb@ripe.net</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Note that it would work with "cat file | ..." but I absolutely hate the<br>
cat-pipe combination. I've been known to mark down interviewees who<br>
offer a solution that involves cats and pipes :)<br></blockquote><div><br></div><div>That was just a minimal example to demonstrate the limitation.   But yes, cat and pipe together in the wild only makes sense if the target of the pipe can *only* take data via stdin, and can't accept a file name on its command line.</div><div><br></div><div>What I'm actually doing is running a bit of code that detects whether a zone file is compressed or not, and by which compression algorithm if it is, selects the correct "open()" function depending on the results, and then reads the file in from that (possibly compressed) file-like object and feeds it into named-checkzone's stdin. </div><div><br></div><div>I like your suggestion of using /dev/stdin as the file though.. I bet I can make that work until 9.18 is out.</div><div><br></div><div><br></div></div></div>