Date: Mon, 22 Jun 2015 03:10:37 +0200 From: Polytropon <freebsd@edvax.de> To: "Lt. Commander" <listmgr@antennex.com> Cc: freebsd-questions@freebsd.org Subject: Re: Script question Message-ID: <20150622031037.420a1db0.freebsd@edvax.de> In-Reply-To: <BAY404-EAS3520468CFD04B6982A1487BCCA20@phx.gbl> References: <BAY182-W89C2924F4BDF0D2BD3810DF4BB0@phx.gbl> <BAY404-EAS148D4B304BB066F07E84004CCB90@phx.gbl> <20150615015516.b3ea7633.freebsd@edvax.de> <2609852.Pc7nSdcYla@desk8.phess.net> <BAY404-EAS3520468CFD04B6982A1487BCCA20@phx.gbl>
next in thread | previous in thread | raw e-mail | index | archive | help
On Sun, 21 Jun 2015 16:32:04 -0500, Lt. Commander wrote: > To: freebsd-questions@freebsd.org > Subject: Re: Script question > > Polytropon wrote: > > Or if you want to omit the grep call: > > > > awk '/spam=YES/ {print $11}' /var/log/maillog | sort | uniq | sed -e > > 's/^.*=//' > /tmp/spam-ip.txt > > > > And then continue: > > > > cat /tmp/spam-ip.txt >> /usr/samba/mail/envelope cat /tmp/spam-ip.txt > > | mail -s "SPAM IPs...." us.navy@outlook.com > > > > Finally, you can easily remove /tmp/spam-ip.txt. > > You could even take this one step further and eliminate the need for a > temporary file altogether by making use of tee(1): > > awk '/spam=YES/ {print $11}' /var/log/maillog | > sort | > uniq | > sed -e 's/^.*=//' | > tee -a /usr/samba/mail/envelope | > mail -s "SPAM IPs...." us.navy@outlook.com > > Patrick > _______________________________________________ > > Hi list! > > The script guys were very helpful in smoothing out my sh shell script and it > with other script calls are doing the job I needed. > > BUT! I took the snippet below to use as an "yes/no" intro to one of the > calls. It must have aged as is because it complains about badly placed "()s" > right near the top of the intro and I suspect it won't agree with another > line further down either. > > Perhaps a hint from the experts as to how to change the problem? To be honest, I don't see any ( or ) in the whole script. Can you post your _current_ version, just to be sure we're looking at the same code? Every other attempt probably is just guesswork... -- Polytropon 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?20150622031037.420a1db0.freebsd>