Alas! Rob 'Feztaa' Park spake thus:
> > I'm into overkill today.
> > 
> > You could put that in a script such as the one I've attached, and run
> > it from .muttrc like this:
> > 
> > source `$HOME/bin/mutt-prep folders=$HOME/mail`

Thanks for your help, guys, this is what I've come up with:

my .muttrc contains this line:

source `~/bin/mbox-hooks`

and the script is attached.

-- 
Rob 'Feztaa' Park
[EMAIL PROTECTED]
--
"The Irish gave the bagpipes to the Scots as a joke, but the Scots
haven't seen the joke yet."
                -- Oliver Herford
#!/bin/bash

# Changing into the mail directory is less processor-intensive than
# running basename on every file
cd ~/mail/

# This is the name of the file to store our mbox hooks in
file="/home/feztaa/.mutt/muttrc-mboxes"

# Prime the file: make sure it's there and overwrite whatever's in it
echo "# Mbox hooks for mutt!" > $file

# For every mbox we have, echo the appropriate mbox-hooks into the file.
for i in *; do
  [ -d "$i" ] || echo "mbox-hook =$i \"=archives/$(date +%Y-%m)-$i\"" >> $file
done

# Echo the filename to stdout so that the source command in .muttrc picks it up.
echo $file

# Change back into the previous directory (this outputs text that we don't want)
cd - > /dev/null 2>&1

Attachment: msg22299/pgp00000.pgp
Description: PGP signature

Reply via email to