cs252/lab3-src-final/shell-tests/test_subshell
2018-10-25 14:45:56 -04:00

20 lines
458 B
Bash
Executable File

#!/bin/bash
echo -e "\033[1;4;93mTest_subshell: test subshell\033[0m"
echo "ls test3 > file-list " > shell-in
echo "ls -al \`cat file-list\` " >> shell-in
../shell < shell-in > shell-out
echo "ls test3 > file-list" > csh-in
echo "ls -al \`cat file-list\` " >> csh-in
/bin/sh < csh-in > csh-out
diff csh-out shell-out > /dev/null 2>&1
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