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

19 lines
350 B
Plaintext
Raw Normal View History

2018-10-25 14:45:56 -04:00
#!/bin/bash
rm -f csh-out shell-out
echo -e "\033[1;4;93mTest_cd5: cd /etc\033[0m"
echo "cd /etc" > shell-in
echo "pwd" >> shell-in
/bin/sh < shell-in > csh-out 2>&1
../shell < shell-in > shell-out 2>&1
diff csh-out shell-out
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