Date: Thu, 23 Apr 2009 08:27:54 +0200 From: Polytropon <freebsd@edvax.de> To: "=?UTF-8?Q?Evuraan::=E0=B4=8F=E0=B4=B5=E0=B5=82=E0=B4=B0=E0=B4=BE?= =?UTF-8?Q?=E0=B4=A8=E0=B5=8D=E2=80=8D?=" <evuraan@gmail.com> Cc: freebsd-questions@freebsd.org Subject: Re: awk question (actively tail a file & notify when expression is found) Message-ID: <20090423082754.a291541b.freebsd@edvax.de> In-Reply-To: <6fbcd0710904221238r1cb63d41qaa331beb683ffa95@mail.gmail.com> References: <6fbcd0710904221238r1cb63d41qaa331beb683ffa95@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, 22 Apr 2009 12:38:47 -0700, Evuraan::ഏവൂരാന് <evuraan@gmail.com> wrote: > but this below, does not work > > tail -f /var/log/apache2/access.log |awk ' /192.168.1.100/ { print > $0 | "mail me@email.address "}' I would suggest to keep the system() approach: tail -f /var/log/apache2/access.log | awk '/192.168.1.100/ { system(sprintf("echo %s | mail me@email.address", $0)); }' > Any pointers would be much appreciated. It should work, but I'm sure someonle else will soon show you some more elegant way. :-) -- Polytropon >From Magdeburg, Germany Happy FreeBSD user since 4.0 Andra moi ennepe, Mousa, ...
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20090423082754.a291541b.freebsd>