Skip to content

Instantly share code, notes, and snippets.

@AdnoC
Created January 15, 2017 02:12
Show Gist options
  • Save AdnoC/218828058c52547a1813432590a21760 to your computer and use it in GitHub Desktop.
Save AdnoC/218828058c52547a1813432590a21760 to your computer and use it in GitHub Desktop.
Let you submit EECS370 projects from your local computer
#/bin/sh
# Usage: Download the scripts needed to submit EECS370 projects and modifies them to run.
# The scripts are downloaded to the current directory.
# This script may break if the instructors modify the submission scripts.
# NOTE: You will probably need to download some perl modules to run submit370.
# I got it to work by installing Email::Date::Format
# Using `cpan Email::Date::Format` _should_ have worked, but I couldn't cpan working
# On Ubuntu 14.04 (on Windows Subsystem for Linux) I got it working by calling
# `sudo apt-get install libemail-date-format-perl`
# (Admittedly, I might have downloaded other required modules while I was flailing around)
# We need your uniqname to download the files and set that you were the one who sent the email
echo "What is your uniqname?"
read uniqname
# Download the files needed to submit the project
scp $uniqname@login.engin.umich.edu:/afs/umich.edu/class/eecs370/bin/submit370 submit370
scp $uniqname@login.engin.umich.edu:/afs/umich.edu/class/eecs370/bin/mail370 mail370
# If your sed does not support the -i switch, change each call to sed to
# cat $file | sed $pattern > $file.new
# mv $file $file.bak
# mv $file.new $file
# Note: The path cannot contain a '|' character
# Use the mail370 script in this directory, not on CAEN
sed -i.bak "s|/afs/umich.edu/class/eecs370/bin/mail370|$(pwd)/mail370|" submit370
# Make sure that we can execute submit370
chmod +x submit370
# Remove the lines that figure out your uniqname
sed -i.bak1 -e '3,6d' mail370
# Just set your uniqname as a constant in the program (add a line to the correct place)
sed -i.bak2 "3iuser = '$uniqname'" mail370
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment