#!/usr/local/bin/bash case $1 in ''|-h) # $Id: zmutt,v 1.2 1997/05/20 11:31:01 sec Exp $ echo This is zmutt, echo a simple frontend for mutt to read gzipped folders echo 'Usage: zmutt ' ;; *.gz) if [ -f ${1%%.gz}.lock ] ; then echo "a copy of mutt is already running on this folder.gz" exit 1 fi echo -n "Uncompressing Folder ...." gzip -dc $1 >${1%%.gz} touch ${1%%.gz}.lock echo "done" mutt -f ${1%%.gz} if [ -z "`find ${1%%.gz} -newer ${1%%.gz}.lock`" ] ;then echo "Nothing modified" rm ${1%%.gz} else rm $1 echo -n "Recompressing Folder ...." gzip -9 ${1%%.gz} echo "done" fi rm ${1%%.gz}.lock ;; *) echo 'Not a compressed folder, continuing anyway :)' exec mutt -f $1 ;; esac