Chet Ramey case.edu> writes:
> > $>cmd_print () { mkfifo zout ; (tee zout &); cat zout ; rm zout; }
> > $>printf 'hello\n' | cmd_print
>
> When job control is not active, Posix requires that a command run in the
> background with `&' behave as if its standard input were /dev/null in the
> absenc
Nathan Coulter wrote:
> Hi,
>
> Within a function, I'd like to print some input to the terminal and at
> the same time store it in a fifo fostore some input in a fifo, but am
> getting mixed results. In this example, I thought "hello" would be
> output twice:
>
> $>cmd_print () { mkfifo zout ;
> ---Original Message---
> From: Nathan Coulter <[EMAIL PROTECTED]>
> Subject: Re: mkfifo and tee within a function
> Sent: 2006-11-28 17:19
> I think that is true for an anonymous pipe, but not for a named pipe.
> Timing is not the issue here. A command
> From: Andreas Schwab <[SNIP]>
> Subject: Re: mkfifo and tee within a function
> Sent: 2006-11-28 15:09
>
> Nathan Coulter <[SNIP]> writes:
>
> > Could anyone please provide a few pointers on how to accomplish this, and
> perhaps explain the re
> From: Andreas Schwab <[EMAIL PROTECTED]>
> Subject: Re: mkfifo and tee within a function
> Sent: 2006-11-28 15:09
>
> Nathan Coulter <[EMAIL PROTECTED]> writes:
>
> > Could anyone please provide a few pointers on how to accomplish this, and
> per
> From: Andreas Schwab <[SNIP]>
> Subject: Re: mkfifo and tee within a function
> Sent: 2006-11-28 15:09
>
> Nathan Coulter <[SNIP]> writes:
>
> > Could anyone please provide a few pointers on how to accomplish this, and
> perhaps explain the re
Nathan Coulter <[EMAIL PROTECTED]> writes:
> Could anyone please provide a few pointers on how to accomplish this, and
> perhaps explain the results from the above examples?
A process writing to a pipe that has no reader will receive EPIPE/SIGPIPE
and die thereof by default. So it all depends o
Nathan Coulter <[EMAIL PROTECTED]> wrote:
> My real goal is to feed data to a function and then source it:
>
> $> cmd_print () { mkfifo zout ; (cat - > zout ) & ; source zout ; rm zout; }
> $> cmd_print < $> date
> $> EOF
> $>
As Andreas said, this will be problematic using a fifo. You could do