Course Management Scripts
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

21 lines
544 B

#!/bin/bash
[ -z "$COURSE" ] && echo "Needs a COURSE set" && exit 1
[ -z "$1" ] && echo "Needs an assignment name" && exit 1
while read USER; do
echo -n "$USER: "
for assn in $*; do
echo -e "\x1b[1;36m$assn:\x1b[0m"
if [ ! -e /course/$COURSE/assn/$USER/$assn ]; then
echo -e "\x1b[1;31mPath /course/$COURSE/assn/$USER/$assn doesn't exist, aborting...\x1b[0m"
continue
fi
if rmdir /course/$COURSE/assn/$USER/$assn; then
echo "(removed)"
else
echo -e "\x1b[1;31m(failed to remove -- not empty?)\x1b[0m"
fi
done
done