2022-12-21 16:52:12 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
# Unofficial Bash Strict Mode
|
|
|
|
set -euo pipefail
|
|
|
|
IFS='
|
|
|
|
'
|
|
|
|
|
2022-12-22 15:32:12 +00:00
|
|
|
FILENAME="student/set-env-vars.sh"
|
|
|
|
|
2022-12-22 15:46:57 +00:00
|
|
|
# echo not allowed
|
2022-12-22 15:32:12 +00:00
|
|
|
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
|
|
|
|
fi
|
|
|
|
|
|
|
|
submitted=$(bash $FILENAME)
|
2022-12-21 16:52:12 +00:00
|
|
|
expected=$(bash solutions/set-env-vars.sh)
|
|
|
|
|
|
|
|
diff <(echo "$submitted") <(echo "$expected")
|