Skip to content

Instantly share code, notes, and snippets.

@gmac
Created March 4, 2015 23:37
Show Gist options
  • Save gmac/7e4cc71fc3f963e60b11 to your computer and use it in GitHub Desktop.
Save gmac/7e4cc71fc3f963e60b11 to your computer and use it in GitHub Desktop.
Assign files to all students
# Copy assignment into each student's folder
# Run this from the day's folder
# example:
# `~/Dev/wdi/homework/week_01/d_01`
# `assign`
assign(){
# path to assignment. defaults to assignment folder.
assignment=${1:-"ASSIGNMENT_FILES/"}
# get list of directories
array=(*/)
# copy assignment folder into each student folder
for dir in "${array[@]}"; do
# don't copy assignment folder into assignment folder
if [ "$dir" != "ASSIGNMENT_FILES/" ]
then
cp -rv $assignment $dir
fi
done
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment