[PLUG] Bash functions...

William A Morita wamorita at hevanet.com
Wed Oct 25 16:34:49 UTC 2006


Michael,

Why the fixation with BASH?  This sounds like a job better done in Perl.

- Bill 
wamorita at hevanet.com 

 

-----Original Message-----
From: plug-bounces at lists.pdxlinux.org
[mailto:plug-bounces at lists.pdxlinux.org] On Behalf Of
plug_0 at robinson-west.com
Sent: Friday, October 20, 2006 6:29 PM
To: plug at lists.pdxlinux.org
Subject: [PLUG] Bash functions...

I am trying to write a bash script to break a postfix mail log down.
I want to seperate the greylist errors from the blacklist errors, etc.
and when I'm done build a useful web page to inform my users.

I'm at the beginning of a project to provide a way to allow users to see who
should be getting through my mail relays that isn't.  I am not really
familiar with a method to make postfix more fine grained on whether an email
server that exhibits problems should be blocked or not directly, so I'm
taking an establish a universal whitelist approach.  
First though, I want to get an informative web page up built on information
culled from /var/log/maillog.

In bash if I make variable bar local to function foo, is bar global to any
function called from within foo?  Another approach is for me to use an array
to sort multiple strings such as "Service is unavailable;", but I want to
avoid that for now.  In C++ there is a concept called namespaces, but this
is for object oriented programming.  Yes an array is a common solution to
store a collection of strings uniquely, but you have to know how many
strings you are going to need ahead of time and possibly how long they will
all be.  So far, I use these identifying strings with grep, tail, and head
to search for a particular class of errors and effectively sort it out from
everything else dumping it to a file.  If there is a syslog or postfix
configuration trick to cause my mail server to log in such a way that the
different types of errors are seperated...

Michael C. Robinson

-------------------------------------------------
This mail sent through IMP: http://horde.org/imp/
_______________________________________________
PLUG mailing list
PLUG at lists.pdxlinux.org
http://lists.pdxlinux.org/mailman/listinfo/plug






More information about the PLUG mailing list