Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm 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 Date: Wed, 30 Jul 2003 15:40:44 -0400 From: Christopher Faylor To: cygwin AT cygwin DOT com Subject: Re: Bash traps - while emitting ERR trap Message-ID: <20030730194044.GA12537@redhat.com> Reply-To: cygwin AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.1i On Wed, Jul 30, 2003 at 12:15:07PM -0700, Andrew DeFaria wrote: >Given the following script: > >#!/bin/bash >function cleanup { echo "ENTER cleanup" >} # cleanup > trap cleanup EXIT ERR > declare -i i=4 echo "Entering while loop" >while [ $i -gt 0 ]; do >echo "In while loop" >let i=i-1 >done echo "After trap is set" >Why is "ENTER cleanup" echoed twice when run? This is really not a cygwin question. If you think this is a bug then you can send email to bug-bash-AT-gnu-PERIOD-org . Otherwise, the usenet newsgroup comp.unix.shell may be able to help. -- Please use the resources at cygwin.com rather than sending personal email. Special for spam email harvesters: send email to aaaspam AT sourceware DOT org and be permanently blocked from mailing lists at sources.redhat.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/