grep raises signal ERR

David Arnstein arnstein@panix.com
Thu May 15 00:40:00 GMT 2008


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/



More information about the Cygwin mailing list