Last active
September 10, 2019 19:04
-
-
Save yochem/6dc68d9510524bb076bc833d8acf3ea8 to your computer and use it in GitHub Desktop.
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
#!/usr/bin/env bash | |
# use current directory if not specified | |
feedback_folder="${1:-$(pwd)}" | |
if [ "$(uname)" == "Darwin" ]; then | |
copy_tool="pbcopy" | |
else | |
copy_tool="xclip -i -selection c" | |
fi | |
echo -e "Press any key to copy the next student's feedback.\n" | |
for i in "$feedback_folder"/*.txt; do | |
# check if file exists | |
[ ! -e "$i" ] && exit 1 | |
"$copy_tool" "$i" | |
echo "Copied content of $(basename $i) to clipboard" | |
read -n 1 -s | |
done | |
# clean up clipboard | |
echo "" | "$copy_tool" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment