$ cat test..test..test | echo hey
hey
cat: test..test..test: No such file or directory
$ echo $?
0
$ cat test..test..test | echo hey
hey
cat: test..test..test: No such file or directory
$ echo $PIPESTATUS
1
$ cat test..test..test | echo hey
hey
cat: test..test..test: No such file or directory
$ echo ${PIPESTATUS[*]}
1 0
возможно, это поможет отловить затыку.