#!/bin/sh COM_BASE="/home/miekg/miek.nl/blog/comments" # a clone of listadmin, but then for acking comments in my site for art in $COM_BASE/*.txt; do for com in $art/new/*; do if [ "$(basename $com)" = "*" ]; then # empty dir continue fi echo "> Article: $(basename $art)" echo " >> Comment found: $(basename $com)" cat $com | sed 's/^/ /' echo read -p "(A)approve (D)discard (N)skip [A]: " reply [ -z $reply ]] && reply="A" case $reply in A*|a*) echo "new/$(basename $com) -> ok/$(basename $com)" if ! mv $com $art/ok ; then echo "$0: mv failed!" fi ;; D*|d*) echo rm "new/$(basename $com)" if ! rm $com; then echo "$0: rm failed!" fi ;; K*|k*) echo "Skipping" ;; esac echo done; done