Tanel Rebane wrote:
> Hello,
>
> a problem occurs when running the following bash shell script:
> #!/usr/bin/env bash
> for (( q = 0 ; q < 10000 ; q++ )); do
> while read -d '' z; do result+=("$z"); done < <(printf
> "%s\000\n" hej | grep -a 'hej')
> done
>
> For some reason the following output is printed:
> ./test.bash: line 4: /var/tmp//sh-np-2094024698: Interrupted system call
> ./test.bash: line 4: /var/tmp//sh-np-1952491205: Interrupted system call
> ./test.bash: line 4: /var/tmp//sh-np-2936939995: Interrupted system call
> ./test.bash: line 4: /var/tmp//sh-np-255058020: Interrupted system call
> etc etc...
>
> This seems to only happen when piping to grep. I'm using FBSD 6.2-STABLE,
> Bash 3.2.33(0)-release and grep (GNU grep) 2.5.1-FreeBSD.
I took a look at this, and it's not just due to the grep. I think it's a
timing problem, but I can't tell what signal is interrupting the open. I
thought it might be SIGCHLD, but I don't think so now. It just seems that
FreeBSD's named pipe implementation is a bit fragile.
Chet
--
``The lyf so short, the craft so long to lerne.'' - Chaucer
Chet Ramey, ITS, CWRU [EMAIL PROTECTED] http://cnswww.cns.cwru.edu/~chet/