#!/bin/csh -f

echo "Running 15-213 homework directory setup program..."

set TOP=/afs/cs/academic/class/15213-s00
set HOME=$home
set USER=$user

if (-e ${HOME}/213hw) then
    echo "There is already a file of some sort named '213hw' in your"
    echo "home directory."
else
    mkdir ${HOME}/213hw
    fs sa ${HOME}/213hw ${USER} all -clear
    ln -s ${TOP} ${HOME}/213hw/classdir

    foreach i (L1 L2 L3 L4 L5)
	mkdir ${HOME}/213hw/${i}
	ln -s ${TOP}/${i} ${HOME}/213hw/${i}/pub
        ln -s ${TOP}/${i}/handin ${HOME}/213hw/${i}/handin
    end

    echo "I have created a directory named '213hw' in your"
    echo "home directory.  213hw contains the following subdirectories:"
    echo
    echo "    213hw/classdir:  this is a link to ${TOP},  "
    echo "                     which is the main class directory."
    echo
    echo "    213hw/L1:        this is a directory you can use to work on"
    echo "                     programming Lab 1."
    echo
    echo "    213hw/L1/pub:    this is a link to the class directory that has"
    echo "                     all the files you will need to complete Lab 1."
    echo
    echo "    213hw/L1/handin: this is a link to the group handin directories"
    echo "                     for Lab 1."
    echo
    echo "    213hw/L2:        directory for assignment 2"
    echo "    213hw/L2/pub:    link to a directory with the files for Lab 2."
    echo "    213hw/L2/handin: link to the group handin directories for Lab 2."
    echo "    (etc.) "
    echo
    echo "The directory 213hw has been set so that ONLY you can see what's in this"
    echo "directory."
    endif
    echo ""
endif
