fix(to-git-or-not-to-git): add check for echo

This commit is contained in:
miguel 2023-05-16 17:06:04 +01:00 committed by MSilva95
parent 6fe1bcf2b2
commit bb59c2fedf
1 changed files with 4 additions and 0 deletions

View File

@ -11,6 +11,10 @@ FILENAME="student/to-git-or-not-to-git.sh"
if [ -f ${FILENAME} ]; then
# FILE exists and it's not empty
if [ -s ${FILENAME} ]; then
if [[ $(cat $FILENAME | grep echo | wc -l) -ne 0 ]]; then
echo "echo is not allowed in this exercise!"
exit 1
fi
submitted=$(bash $FILENAME)
expected=$(bash solutions/to-git-or-not-to-git.sh)
diff <(echo "$submitted") <(echo "$expected")