[LUNI] Help with awk

Joe Frost joe-list at the-frosts.org
Mon Apr 5 05:45:36 CDT 2004


On Mon, Apr 05, 2004 at 12:37:48AM -0500, Stef wrote:
> I am sorry if this is not the right place, but I have this desperate 
> need to resolve an issue with a Postfix honeypot, and - as not much of 
> a shell script person - I am stuck with a problem: I want to determine 
> and print out the messages in the queue, whose size are between 
> (0-2000), (3000-7000) and >8000 (second field in postqueue -p output), 
> but I can either eliminate the last line, nor put a LF between each 
> value found (let alone passing these values to some other script, to 
> process the field ID). Here is what I have now:
> 
> # postqueue -p |awk '$2 !~ /ID/ && ($2 < 2000 || ($2 > 3000 && $2 < 
> 7000) || $2 > 8000) {printf $2} END {printf "\n"}'
> 
> which will eliminate the ID field, but not the space between multiple 
> occurrences, neither the last line (with the totals) ...
> 
> ... anybody with any ideas here?!?

Could you send a snippet of the postqueue -p output?

Joe


More information about the luni mailing list