All of lore.kernel.org
 help / color / mirror / Atom feed
From: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
To: Paul Jackson <pj@sgi.com>, Linus Torvalds <torvalds@osdl.org>
Cc: git@vger.kernel.org, pasky@ucw.cz
Subject: Re: How to get bash to shut up about SIGPIPE?
Date: Sat, 30 Apr 2005 13:04:10 +0200	[thread overview]
Message-ID: <20050430110410.GA25322@lsrfire.ath.cx> (raw)
In-Reply-To: <20050429232922.03057aba.pj@sgi.com>

On Fri, Apr 29, 2005 at 11:29:22PM -0700, Paul Jackson wrote:
> Linus replied to pj:
> > > Code Sample 2:
> > > ...
> > Didn't change anything for me. Same thing.
> 
> I don't believe you did what I did.
> 
> The source code for bash, both 2.x and 3.x versions, clearly displays a
> simpler error message (no line number or redisplay of your script
> commands) in the case that you set a trap.  And I tested both shells on
> a multiprocessor, to verify that they behaved as I expected, running
> these silly little scripts.

I don't have a multiprocessor and I see the same.  Are you sure it's SMP
dependant?

Your solution (trapping _inside_ the job, too) works for me, btw.  Here's
a patch for cg-log that reduces the clutter to two "Broken pipe" lines
(pun not intended).

Rene


--- cg-log~	2005-04-29 23:43:09.000000000 +0200
+++ cg-log	2005-04-30 12:15:40.000000000 +0200
@@ -16,6 +16,7 @@
 # or id1:id2 representing an (id1;id2] range of commits to show.
 
 . cg-Xlib
+trap exit SIGPIPE
 
 if [ "$1" = "-c" ]; then
 	shift
@@ -47,6 +48,7 @@
 fi
 
 $revls | $revsort | while read time commit parents; do
+	trap exit SIGPIPE
 	[ "$revfmt" = "rev-list" ] && commit="$time"
 	echo $colheader""commit ${commit%:*} $coldefault;
 	cat-file commit $commit | \

  reply	other threads:[~2005-04-30 10:58 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-04-28 18:28 How to get bash to shut up about SIGPIPE? Linus Torvalds
2005-04-28 19:03 ` Rene Scharfe
2005-04-28 19:21   ` Linus Torvalds
2005-04-28 20:13     ` Rene Scharfe
2005-04-28 20:27     ` Ryan Anderson
2005-04-28 20:47       ` Linus Torvalds
2005-05-01 12:07       ` Herbert Xu
2005-05-01 15:51         ` David A. Wheeler
2005-05-02 16:10           ` Paul Jackson
2005-05-04  2:30             ` David A. Wheeler
2005-05-04  2:50               ` Linus Torvalds
2005-05-04  8:26                 ` Herbert Xu
2005-04-28 21:31 ` Edgar Toernig
2005-04-28 22:16   ` Linus Torvalds
2005-04-29  1:00 ` Joshua T. Corbin
2005-04-30  0:22 ` Paul Jackson
2005-04-30  2:59   ` Linus Torvalds
2005-04-30  6:29     ` Paul Jackson
2005-04-30 11:04       ` Rene Scharfe [this message]
2005-05-02 22:17         ` Paul Jackson
2005-05-02 23:17         ` Petr Baudis
2005-05-03  1:44           ` Paul Jackson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20050430110410.GA25322@lsrfire.ath.cx \
    --to=rene.scharfe@lsrfire.ath.cx \
    --cc=git@vger.kernel.org \
    --cc=pasky@ucw.cz \
    --cc=pj@sgi.com \
    --cc=torvalds@osdl.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.