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.

Thanks in advance,
Tanel Rebane


Reply via email to