Re: mkfifo and tee within a function

2006-12-06 Thread Eric Blake
Chet Ramey chet.ramey at 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

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 ; (tee zout

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 EOF $ date $ EOF $ As Andreas said, this will be problematic using a fifo. You could do it with a

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 on

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 results from the above examples? A process writing

mkfifo and tee within a function

2006-11-28 Thread Nathan Coulter
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 ; (tee zout ); cat zout ; rm zout; }

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 perhaps explain the results from the above examples

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 results from the above examples? A process writing