#!/bin/csh -f # # Usage: setup # setting up the account. # set DIR = /afs/nd.edu/courses/math/math325.02 if (-f $HOME/math325/Assignment.nb) then echo "You already have a file Assignment.nb in your math325 Dir" echo "If you messed up this file, rename this file and run this script again" echo "Opening THIS file with mathematica" mathematica $HOME/math325/Assignment.nb & exit(-1) endif echo " Check your home directory. If it contains math325 ," echo " you should rename them before running this script. " echo -n " Proceed? (y/n) " if ( $< != 'y' ) exit(-1) set math325 = `grep "$DIR/bin" "$HOME/.cshrc"` if ( "$math325" != '') then echo "Check your .cshrc file. It may already be set" else echo "adding the path for the course" echo 'set path = ( $path '"$DIR"'/bin )' \ >>"$HOME/.cshrc" echo "done" endif sleep 1 echo "make a link the the course folder, called Math325" ln -s "$DIR" "$HOME/Math325" echo "done" sleep 1 echo "make a directory math325 for doing computer assignment" mkdir $HOME/math325 echo "done" sleep 1 echo "set permissions for math325" fs setacl $HOME/math325 system:anyuser none echo "done" sleep 1 echo "copying assignment" cp -p "$DIR/Assignment.nb" "$HOME/math325" echo "done" sleep 1 echo "Now you can open your assignment with mathematica in your math325 folder" sleep 1 echo "OPENING mathematica with THE Assignment.nb" mathematica $HOME/math325/Assignment.nb &