From owner-freebsd-questions@FreeBSD.ORG Tue Jun 16 06:48:29 2015 Return-Path: Delivered-To: freebsd-questions@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 048D2539 for ; Tue, 16 Jun 2015 06:48:29 +0000 (UTC) (envelope-from kraduk@gmail.com) Received: from mail-wg0-x22c.google.com (mail-wg0-x22c.google.com [IPv6:2a00:1450:400c:c00::22c]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8D54CAE3 for ; Tue, 16 Jun 2015 06:48:28 +0000 (UTC) (envelope-from kraduk@gmail.com) Received: by wgbhy7 with SMTP id hy7so4931024wgb.2 for ; Mon, 15 Jun 2015 23:48:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=Ext+HdZnINdiSm8ARqOgisKEpOpfZKgRbtJPDqCD5VU=; b=mQ6rVknxiBp4Y+AoJThRocfGWqB3wRmWGQijYvLkkg5jX9I6IJqNI563unClodl2qQ gCvLn5TmO8fq4bN7f8c7b3oiLKOMNWlW84jrkcNjsi3IQWSE12fsRo5NJwJWChzm9RKr 6tWANK6IbmmRHlmf/NeTORnqYKr3WOYsrRdVNTXq8OcNIfrGylLM6f22WJSxyUnak90t p9suId1Hz/FMAdvdMiqFwFnpXgHjzH82Bm+7C0w83mYlsue6L18TwPabhndL2xvIze6S bNqcDzkrRMK1eW2dUtxOhOcyo5d+rdQBIvPgpoPYHeNlpxO+IS20T7AL2oznEphtlypf MQpw== MIME-Version: 1.0 X-Received: by 10.180.78.136 with SMTP id b8mr3275582wix.89.1434437307065; Mon, 15 Jun 2015 23:48:27 -0700 (PDT) Received: by 10.28.210.149 with HTTP; Mon, 15 Jun 2015 23:48:26 -0700 (PDT) In-Reply-To: <20150615165110.GB23194@neutralgood.org> References: <557B8484.9060405@gmail.com> <557C6DED.9070105@gmail.com> <20150615015516.b3ea7633.freebsd@edvax.de> <20150615165110.GB23194@neutralgood.org> Date: Tue, 16 Jun 2015 07:48:26 +0100 Message-ID: Subject: Re: Script question From: krad To: kpneal@pobox.com Cc: Polytropon , "Lt. Commander" , FreeBSD Questions Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.20 X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Jun 2015 06:48:29 -0000 dont do it willy nilly though as if you fill /tmp it can cause a system issues, especially for tmpfs backed systems, and always clean up after yourself On 15 June 2015 at 17:51, wrote: > On Mon, Jun 15, 2015 at 01:55:16AM +0200, Polytropon wrote: > > On Sun, 14 Jun 2015 15:07:18 -0500, Lt. Commander wrote: > > > I know it's ugly..... but places a list of the IPs in a file plus > sends me a > > > message with the same list. > > > > Yes, it is ugly, but will probably work fine. :-) > > > > Allow me a few comments: > > > > > #!/bin/sh > > > cd /var/log > > > > Use absolute file names - you're accessing /var/log/maillog > > only once. > > Seconded. > > > > grep -i spam=YES maillog > spam.tmp && \ > > > > Don't write temporary files to /var/log, use /tmp instead. > > Major, major seconded. On top of that, use the mktemp command in scripts. > > -- > Kevin P. Neal http://www.pobox.com/~kpn/ > "Not even the dumbest terrorist would choose an encryption program that > allowed the U.S. government to hold the key." -- (Fortune magazine > is smarter than the US government, Oct 29 2001, page 196.) > _______________________________________________ > freebsd-questions@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-questions > To unsubscribe, send any mail to " > freebsd-questions-unsubscribe@freebsd.org" >