#!/bin/sh KDU_COMPRESS=/usr/compat/linux/usr/bin/kdu_compress cleanup() { [ "$if" = ~/.kdu_in.ppm ] && rm -f $if; rm -f $of trap '' 0; exit $1 } trap 'cleanup' 0 1 2 3 13 15 if [ $# -eq 0 ]; then if=~/.kdu_in.ppm cat >$if || cleanup $? else if=$1 fi of=~/.kdu_out.jpf $KDU_COMPRESS -quiet -i "$if" -o $of Creversible=yes 1>&2 || cleanup $? cat $of || cleanup $? .