>  -------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 which opens a named pipe for writing 
> should block until a reader comes online.  In the following example, I get an 
> error with "source', but not with "cat".  Why?
>  
>  $>cmd_print () { mkfifo zout; tee zout & cat zout >/dev/null ; rm zout; }
>  $>cmd_print <<EOF
>  > date
>  > EOF
>  [1] 5263
>  date
>  [1]+  Done                    tee zout
>  $>cmd_print () { mkfifo zout; tee zout & source zout ; rm zout; }
>  $>cmd_print <<EOF
>  > date
>  > EOF
>  [1] 5267
>  $>date
>  tee: zout: Broken pipe
>  

In the following example, I get different output depending on whether I source 
the script or invoke it.  Is there an explanation for this or is it a bug?

$>cat test1
#!/bin/bash

cmd_print () { mkfifo zout; tee zout & cat zout; rm zout; }
cmd_print <<EOF
date
EOF
$>source test1
date
date
[1]+  Done                    tee zout
$>./test1
$>

-- 
Nathan Coulter


_______________________________________________
Bug-bash mailing list
Bug-bash@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-bash

Reply via email to