delorie.com/archives/browse.cgi | search |
X-Recipient: | archive-cygwin AT delorie DOT com |
X-Spam-Check-By: | sourceware.org |
Message-ID: | <f60fe000805141742h14657bf9gbf728cbb3d3ab1d2@mail.gmail.com> |
Date: | Wed, 14 May 2008 20:42:19 -0400 |
From: | "Mark J. Reed" <markjreed AT mail DOT com> |
To: | cygwin AT cygwin DOT com |
Subject: | Re: grep raises signal ERR |
In-Reply-To: | <f60fe000805141740s66d29a6cq49ad7eb5e2c04d86@mail.gmail.com> |
MIME-Version: | 1.0 |
References: | <20080515003601 DOT GA18386 AT panix DOT com> <f60fe000805141740s66d29a6cq49ad7eb5e2c04d86 AT mail DOT gmail DOT com> |
X-Google-Sender-Auth: | 2d55d26767bb7b07 |
X-IsSubscribed: | yes |
Mailing-List: | contact cygwin-help AT cygwin DOT com; run by ezmlm |
List-Id: | <cygwin.cygwin.com> |
List-Unsubscribe: | <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT com> |
List-Subscribe: | <mailto:cygwin-subscribe AT cygwin DOT com> |
List-Archive: | <http://sourceware.org/ml/cygwin/> |
List-Post: | <mailto:cygwin AT cygwin DOT com> |
List-Help: | <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs> |
Sender: | cygwin-owner AT cygwin DOT com |
Mail-Followup-To: | cygwin AT cygwin DOT com |
Delivered-To: | mailing list cygwin AT cygwin DOT com |
Oh, you want to clean up tempfiles. If they're scratch files that should get deleted no matter what, why not use EXIT to clean them up? On 5/14/08, Mark J. Reed <markjreed AT mail DOT com> wrote: > You seem to be confused. ERR is not a signal; it is a shell feature > designed to trap exactly the circumstance you're seeing: some command > exits with nonzero status. A nonzero exit status is an "error", which > is what ERR traps. > > What do you *want* the "aborting" message to mean? > > > > On 5/14/08, David Arnstein <arnstein AT panix DOT com> wrote: >> Is this a bug? The following three-line shell script prints out the >> string >> <aborting> >> when executed. >> >> #!/bin/bash >> trap "echo '<aborting>' ; exit 1" ERR >> grep -q -e 'foo' < /dev/null >> >> This indicates that grep has raised the signal ERR. It is inconvenient >> for me. I am attempting to clean up some scratch files whenever a >> shell script aborts. I use the trap command to do this. However, the >> above command >> grep -q -e 'foo' < /dev/null >> is NOT aborting my shell script. It simply returns status 1, which I >> do NOT want to handle by calling exit. >> >> -- >> Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple >> Problem reports: http://cygwin.com/problems.html >> Documentation: http://cygwin.com/docs.html >> FAQ: http://cygwin.com/faq/ >> >> > > -- > Sent from Gmail for mobile | mobile.google.com > > Mark J. Reed <markjreed AT gmail DOT com> > -- Sent from Gmail for mobile | mobile.google.com Mark J. Reed <markjreed AT gmail DOT com> -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/
webmaster | delorie software privacy |
Copyright © 2019 by DJ Delorie | Updated Jul 2019 |