Last active
August 29, 2015 14:15
-
-
Save mnstrspeed/33e20087dec80e1d5886 to your computer and use it in GitHub Desktop.
[FP] Keeps throwing ungraded work at you until you beg for mercy
This file contains hidden or 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
#! /bin/bash | |
# shitstorm.sh keeps throwing ungraded work at | |
# you until you beg for mercy | |
EDITOR="vi -p" | |
for fulldir in "${1:+$1/}"[sez][0-9]*; do | |
dir="${fulldir##*/}" | |
file="${fulldir}/${dir}.txt" | |
GRADE=`sed -n '/^Current Grade:[[:space:]]*/s///p' "$file"` | |
if [ "$GRADE" = "Not Yet Graded" ] || ! grep -q "Feedback:" "$file"; then | |
read -p "Next up: $dir. Beg for mercy [please stop|come at me bro] " | |
if [[ $REPLY == *"please stop"* ]]; then | |
echo "You're weak." | |
exit 0 | |
fi | |
$EDITOR `find $fulldir -type f \( -iname \*.txt -o -iname \*.icl -o -iname \*.dcl \)` | |
fi | |
done | |
echo "Looks like you survived... this time" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment