[lug] Process substitution.

David L. Anselmi anselmi at anselmi.us
Mon Sep 20 23:13:09 MDT 2010


Jeffrey Haemer wrote:
> You could report it as a bug and offer a patch that checks for fifos,
> too.

I'll do that if I figure out why the code behaves as it does.  Thanks for the encouragement.

> Also, is that enough?  For example, should they also permit you to pipe
> stuff in, like this?
>
>     echo "/home/dave/tmp/Logrotate/a.log { ..."  |  logrotate -s -d
> /home/dave/tmp/state /dev/stdin
>
> Some programs punt these decisions, and let the user use '-' as a filename
> that says, "I know what I'm doing.  Take the input from standard in."

They don't read from stdin, nor from -.  (Using - as a file name results in "cannot stat" and an 
error status, so that's better than nothing.)  If it's really easy to add that I might.  But since 
it doesn't currently use stdin for anything it might be a bigger change than I'm up for (I don't 
know much about writing C).

> Still, if they're guarding against the user's doing something unintended,
> they might print the message to stderr and bail with a non-zero exit status,
> instead of just ignoring you.

Yeah, that's a bug worth filing in any case, I think.

>    vi<(date)
>
> works without complaint. Go figure.  :-)

Cool, me too.  And even:

   vimdiff <(date) <(uname)

I wonder what it was I tried before?

Dave



More information about the LUG mailing list