[WBEL-users] bash causes sporadic job control output

Kirby Bohling kbohling@birddog.com
Tue, 20 Jul 2004 15:18:16 -0500


On Tue, Jul 20, 2004 at 01:55:51PM -0600, Alan Sparks wrote:
> Andy Rabagliati wrote:
> >On Tue, 20 Jul 2004, Alan Sparks wrote:
> >
> >
> >>====== the script for reference =====
> >>#!/bin/sh
> >>/opt/sendmail/mailq \
> >>       | perl -n -e '/^\s+\<.*\@(.*)\>/ && print "$1\n"' \
> >>       | sort \
> >>       | uniq -c \
> >>       | sort -nr
> >
> >
> >No lurking spaces after those backslashes ?
> 
> Nope.  Been there, done that...
> 
> >Try sticking it all on one line ?
> 
> Nope, been there, done that... :-)
> 
> >md5sum the scripts on the different boxes just to make sure ?
> 
> Script is identical.  No strange bits.
> Apparently the problem is bash's reaction to SIGPIPE.  Bash is reporting 
> a 'broken pipe' on the last command in the script pipeline, caused by 
> the "head" I pipe the script output into (viz: "mtabacklog | head").

I run that script without problem.  My only difference is, I'm using
/usr/bin/mailq.  And the data I am getting looks completely sane.

Some how I think you are seeing a data error with escaping.  Have
you tried moving the data over to a Fedora Core machine?  So the
input data is exactly the same.

	I can't remember for sure, but doesn't tcsh have a specific list
of things to does differently (I want to say, {}, (), environment
variables, and something else get treated differently, which is why
Oracle ships two versions of oraenv, one to use in a Bourne style
shell, and one to use in a C-Shell style shell.).  I've only used
bash, so you have me.

I'd try running partial versions of that pipeline and see what comes
out of it.  Something is getting lost in there.  I've seen the
SIGPIPE thing on several versions of RedHat.  My guess is that
something is going on in that perl script which is causing it to do
something crazy and end the escaping (I'm not enough of a perl
hacker to know), the rest of the commands look completely sane to
me, and nothing I know of could go wrong.  I'd want to see the full
text of the output of the mailq command to look at.  If you don't
care, post it a URL I can grab it from and I look at it.

	Thanks,
		Kirby

> 
> So far I've been trying to understand why it's so different between WBEL 
> (and I suppose it'd be the same on RHEL) and everything else (like older 
> RH releases and on Fedora).
> 
> -- 
> Alan Sparks, Sr. UNIX Administrator	asparks@quris.com
> Quris, Inc.				(720) 836-2058
> _______________________________________________
> Whitebox-users mailing list
> Whitebox-users@beau.org
> http://beau.org/mailman/listinfo/whitebox-users
>