Skip to content

Instantly share code, notes, and snippets.

@mnstrspeed
Last active August 29, 2015 14:15
Show Gist options
  • Save mnstrspeed/33e20087dec80e1d5886 to your computer and use it in GitHub Desktop.
Save mnstrspeed/33e20087dec80e1d5886 to your computer and use it in GitHub Desktop.
[FP] Keeps throwing ungraded work at you until you beg for mercy
#! /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