[WBEL-users] bash causes sporadic job control output

Alan Sparks asparks@quris.com
Tue, 20 Jul 2004 15:02:21 -0600


Kirby Bohling wrote:
> Something isn't correct.  You either aren't running what you think
> you are, or there is a cut and paste gone bad....

K, I sure this is getting off-topic for this list, but anyway...

Code as of this afternoon:
#!/bin/sh
PATH=/opt/sendmail:/opt/sendmail/bin:$PATH
mailq -v \
         | perl -n -e '/^\s+\<.*\@(.*)\>/ && print "$1\n"' \
         | sort \
         | uniq -c \
         | sort -nr

Just for fun, to show that the basic problem is bash and its SIGPIPE 
behavior:

$ mtabacklog |awk 'NR<10 {print}'
      22 belsouth.net
      20 verison.net
      20 hotamil.com
      18 yohoo.com
      18 yaho.com
      16 yhoo.com
      16 hotmail.
      12 earhtlink.net
      10 aol.ocm
[asparks@testemail11 asparks]$

$ mtabacklog |head
      22 belsouth.net
      20 verison.net
      20 hotamil.com
      18 yohoo.com
      18 yaho.com
      16 yhoo.com
      16 hotmail.
      12 earhtlink.net
      10 aol.ocm
      10 aol.comy
/home/asparks/bin/mtabacklog: line 7: 14830 Done                    mailq -v
      14831                       | perl -n -e '/^\s+\<.*\@(.*)\>/ && 
print "$1\n"'
      14832                       | sort
      14833                       | uniq -c
      14834 Broken pipe             | sort -nr
[asparks@testemail11 asparks]$

Hell, at this point I'm not sure where the real problem is, bash or 
coreutils.  Or just this week...
-Alan

-- 
Alan Sparks, Sr. UNIX Administrator	asparks@quris.com
Quris, Inc.				(720) 836-2058