[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[ale] Need some scripting assistance
- Subject: [ale] Need some scripting assistance
- From: byron at cc.gatech.edu (Byron A Jeff)
- Date: Wed, 28 Jun 2006 12:36:25 -0400
- In-reply-to: <06d101c69ac2$591c5600$018410ac@win2kpro1>
- References: <06d101c69ac2$591c5600$018410ac@win2kpro1>
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