Warning: this is an htmlized version!
The original is across this link,
and the conversion rules are here.
#!/bin/bash
# (find-angg ".fvwm/.fvwm2rc" "DebianMenu")
# (find-angg ".zshrc" "myincr")
# (find-man "1 convert")
# See:
#   (find-angg "bin/Xscreenshot")

# (find-man "1 xwd")
# (find-man "1 xwd" "-root ")
# (find-man "1 xwd" "-nobdrs ")
# (find-man "1 xwd" "-frame ")
# A trick to take a full-screen screenshot after 10 seconds:
#   (find-sh0 "sleep 10; Xscreenshot -root")
# Ooops, I broke the part that used "$*"...
#
# Tests:
#   (find-sh0 "rm -v /tmp/screenshots/n")
#   (find-sh0 "Xscreenshot")
#   (find-sh0 "Xscreenshot")
#   (find-sh0 "Xscreenshot last")
#   (find-sh0 "cat /tmp/screenshots/n")
#   (find-sh0 "echo /tmp/screenshots/$(cat /tmp/screenshots/n).png")
#   (find-sh0 "printf /tmp/screenshots/ss%02d.png 9")
#   (find-fline "/tmp/screenshots/")
#   (find-fline "/tmp/screenshots/n")

DIR=/tmp/screenshots
FMT=/tmp/screenshots/ss%02d.png
NFILE=/tmp/screenshots/n

mkdir -p $DIR
cd       $DIR || { echo "can't cd to $DIR"; exit 1; }
if [ ! -e $NFILE ]; then 
  echo 0 > $NFILE
fi

   N=$(cat $NFILE)
NEWN=$[$N+1]

case "_$1_" in
   _last_)  printf $FMT $N;;
       __)  xwd | convert - $(printf $FMT $NEWN); echo $NEWN > $NFILE;;
  _named_)  xwd | convert - $2;;
        *)  echo ERROR;;
esac