Re: mkfifo and tee within a function

2006-12-06 Thread Eric Blake
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

Re: mkfifo and tee within a function

2006-12-05 Thread Chet Ramey
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 ;

Re: mkfifo and tee within a function

2006-11-30 Thread Nathan Coulter
> ---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

Re: mkfifo and tee within a function

2006-11-28 Thread Poor Yorick
> 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

Re: mkfifo and tee within a function

2006-11-28 Thread Poor Yorick
> 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

Re: mkfifo and tee within a function

2006-11-28 Thread Nathan Coulter
> 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

Re: mkfifo and tee within a function

2006-11-28 Thread Andreas Schwab
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

Re: mkfifo and tee within a function

2006-11-28 Thread Paul Jarc
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