--- /dev/null
+#!/bin/bash
+
+FILE="./tmp~"
+rm -f $FILE
+for pic in `grep includegraphics $1/*.tex | sed 's/\(.*{\)\(.*\)}.*/\2/'`; do
+ [ -n "$pic" ] &&
+ echo "$pic" >> \
+ $FILE
+ echo "$pic" | sed 's/eps/fig/g' >> \
+ $FILE
+ echo "$pic" | sed 's/eps/agr/g' >> \
+ $FILE
+ echo "$pic" | sed 's/eps/xcf/g' >> \
+ $FILE
+ echo "$pic" | sed 's/eps/plot/g' >> \
+ $FILE
+done
+echo "syncing the following files:"
+cat $FILE
+RSYNC="rsync -avz -e ssh --files-from=$FILE"
+$RSYNC img/ frank-z@pc05ep4:~/work/lectures/latex/nlsop/img/ 2>/dev/null
+$RSYNC frank-z@pc05ep4:~/work/lectures/latex/nlsop/img/ img/ 2>/dev/null
+rm -f $FILE
+echo
+echo done