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.

18 lines
447 B

#!/bin/bash
[ -z "$COURSE" ] && echo "Needs a COURSE set" && exit 1
while read USER; do
echo -n "$USER: "
HOME=`eval echo "~$USER"`
if [ -e $HOME/$COURSE -a ! -L $HOME/$COURSE ]; then
echo -e "\x1b[1;31mExisting item not a file! Aborting...\x1b[0m"
continue
fi
if [ -e $HOME/$COURSE ]; then
echo -n "(removing existing link) "
rm $HOME/$COURSE
fi
ln -s /course/$COURSE/assn/$USER/ $HOME/$COURSE
ls --color -la $HOME/$COURSE
done