nmh-workers
[Top] [All Lists]

Re: [Nmh-workers] Wish last item: allow + as separate argument

2005-12-27 11:25:19
In message <200512271753.jBRHrlXq023521@tad.dad.org>, Norman Shapiro writes:
It would be nice to allow "+ folder" to mean "+folder". This would make it 
easier
to use shell wild cards in scripts and to use argument completion in 
interactive
shells.

The only downside I can think of is breaking scripts that depend on the
undocumented feature that an unadorned plus sign represents the mail 
directory. I
don't know if there are any scripts out there that use that feature.

Don't know if it is the example script your are looking for.  I am using
this shell script to remove old email from my Mail directory:

----------------------------------------------
#!/bin/sh
#
# $Id: purge,v 1.12.6.1 2004/08/06 08:32:51 sobrado Rel $
#
# Expunges deleted messages from the MH(1)/nmh(1) folders.  Messages must be
# previously removed by renaming the message files with preceding commas.
#

PATH=/bin:/usr/bin:/opt/nmh/bin

while [ $# -gt 0 ]; do
        case "$1" in
        +*)     folder="$1"
                ;;
        -after) time="$2"
                shift
                ;;
        esac
        shift
done

find `mhpath ${folder:-+}` -name ",*" -type f -mtime +${time:-7} -exec rm {} \;
----------------------------------------------

I suppose that this script will be compatible with the change you propose,
but I cannot be sure.

Best regards!
Igor.


_______________________________________________
Nmh-workers mailing list
Nmh-workers@nongnu.org
http://lists.nongnu.org/mailman/listinfo/nmh-workers

<Prev in Thread] Current Thread [Next in Thread>