X-Recipient: archive-cygwin AT delorie DOT com X-Spam-Check-By: sourceware.org Date: Wed, 14 May 2008 20:36:02 -0400 From: David Arnstein To: cygwin AT cygwin DOT com Subject: grep raises signal ERR Message-ID: <20080515003601.GA18386@panix.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.10i Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Is this a bug? The following three-line shell script prints out the string when executed. #!/bin/bash trap "echo '' ; 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/