dia_export-diagrams.sh
#!/bin/bash
#
# uses the dia http://live.gnome.org/Dia command line interface to
# re-generate .png diagrams from .dia files in a directory, this way
# - you can get images of diagrams regenerated 'automatically' everytime
# you modify a diagram (.dia file)
# - you do not have to keep your images in sync with diagrams manually
# - you do not need to store .png/.jpg/.svg in repository
# - can be run as a hook, inotify, cronjob
#
DIA=/usr/bin/dia
for file in `ls | grep -i ".*\.dia$"`
do
base=`expr "$file" : '\(.*\)\.dia$'`
$DIA --export=$base.png --filter=pixbuf-png $file
done