#!/bin/sh find -name '*.xcf' | while read i; do j="${i%%.xcf}.jpeg" if [ ! "$i" -ot "$j" ]; then convert "$i" -flatten "$j" fi done