From: Herta Van den Eynde Subject: Re: Need Help with making a bash script Date: Sat, 29 May 2004 00:43:20 +0200 Sender: linux-admin-owner@vger.kernel.org Message-ID: <1085784200.40b7c088ed57d@webmail2.kuleuven.be> References: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="-MOQ1085784200f7e580663efb4349509d11ac8e3437ed" Return-path: In-Reply-To: List-Id: To: linux-admin@vger.kernel.org This message is in MIME format. ---MOQ1085784200f7e580663efb4349509d11ac8e3437ed Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit ip.bsh expects a file with ip addresses named ip.in in the same directory. It will produce ip.out. Don't cut-n-paste the script as you'll probably lose the tabs (they've been entered with + in vi, in case you wondered). email.bsh expects a file email.in with the IDs, and produces email.out. Kind regards, Herta Quoting Fernando : > I have two problems. > > > 1. I'm making a script to add IP's to my blacklist... > > I need to add three , the word 'REJECT' and a #DDMMYYYY that it's > being done to a text file that has the IP's in it... ie this is the > original list; > > 80.25.148.216 > 80.43.197.197 > > needs to end up like this... > > 80.25.148.216 REJECT #28052004 > 80.43.197.197 REJECT #28052004 > > > > 2. The second is a little bit more complicated. > > My server is having trouble deleting virus emails, I want to help it > along with a little cron job that will clear out virus emails every 10 > minutes or so. I get the list of infected emails from the maillog but in > > the maillog only the email ID is displayed. In the actual queue there > are two files per 1 email ID. > > ie... this is what the log spits out as emails that are infected that I > want to delete... > > foo1 > foo2 > foo3 > > but in the queue there are two files per email, a qffoo and a dffoo so > in the queue the previous emails would actually be... > > dffoo1 > qffoo1 > dffoo2 > qffoo2 > dffoo3 > qffoo3 > > So, is it possible to run rm with a wildcard to compensate for the df qf > > letters and still feed it the list of email ID's which make up the last > part of the df qf files? > > > don't have a clue where to start, thanks > > Fernando > > - > To unsubscribe from this list: send the line "unsubscribe linux-admin" > in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html > ---MOQ1085784200f7e580663efb4349509d11ac8e3437ed Content-Type: application/octet-stream; name="ip.bsh" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="ip.bsh" IyEvYmluL2Jhc2gKc2VkIC1lICJzOiQ6CQkJUkVKRUNUICBcI2BkYXRlICslZCVtJVlgOiIgaXAu aW4gPiBpcC5vdXQK ---MOQ1085784200f7e580663efb4349509d11ac8e3437ed Content-Type: application/octet-stream; name="email.bsh" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="email.bsh" IyEvYmluL2Jhc2gKc2VkIC1lICJzOi4qOnJtIGRmJjsgcm0gcWYmOiIgZW1haWwuaW4gPiBlbWFp bC5vdXQK ---MOQ1085784200f7e580663efb4349509d11ac8e3437ed--