#!/bin/sh
rm -f err1 err2 csh-out shell-out
echo "Test8: Pipes and error redirection"
echo "cat file1.cc | ls nonexisting >& err1" > shell-in
echo "cat file1.cc | ls nonexisting > err2 2>&1" > csh-in
/bin/sh < csh-in > csh-out 2>&1
../shell < shell-in > shell-out 2>&1

diff err1 err2
if [ $? -ne 0 ]
then
    echo "Test8 failed"
    exit -1
fi
echo Test8 OK
exit 0
