Created
March 4, 2015 23:37
-
-
Save gmac/7e4cc71fc3f963e60b11 to your computer and use it in GitHub Desktop.
Assign files to all students
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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