cs252/lab3-src-final/shell-tests/test8

17 lines
405 B
Plaintext
Raw Permalink Normal View History

2018-10-25 14:45:56 -04:00
#!/bin/bash
echo -e "\033[1;4;93mTest8: Pipes and output redirection\033[0m"
rm -f out1 out2 csh-out shell-out
echo "cat file1.cc | grep malloc > out1" > shell-in
echo "cat file1.cc | grep malloc > out2" > csh-in
/bin/sh < csh-in > csh-out
../shell < shell-in > shell-out
diff out1 out2
if [ $? -ne 0 ]
then
echo -e "\033[1;31m$0 Failed\033[0m"
exit -1
fi
echo -e "\033[1;32m$0 Passed\033[0m"
exit 0