[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[ale] Need some scripting assistance



On Wed, Jun 28, 2006 at 10:51:33AM -0400, Ryan Fish wrote:
> I am in need of help with figuring out how to grep for "mail.panteq.com"
> within /var/spool/mqueue/* and deleting every message that contains this
> string.

Try this on for size (note it is only minimally tested):

################# cut here #######################
#!/bin/bash
for mail in /var/spool/mqueue/* ; do
  grep -q "mail\.panteq\.com" "$mail" && rm -i $mail
done
################# cut here #######################

If you feel real sure about it you can remove the -i from the rm command.

Hope this helps,

BAJ