This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: grep raises signal ERR


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@mail.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@panix.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@gmail.com>
>

-- 
Sent from Gmail for mobile | mobile.google.com

Mark J. Reed <markjreed@gmail.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/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]