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 Message-ID: <4284A1A2.6060306@byu.net> Date: Fri, 13 May 2005 06:46:26 -0600 From: Eric Blake User-Agent: Mozilla Thunderbird 1.0.2 (Windows/20050317) MIME-Version: 1.0 To: Pekka Niiranen CC: cygwin AT cygwin DOT com Subject: Re: SOLUTION: Strange behaviour with output redirection (MORE information, Bug in awk.exe?) References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-IsSubscribed: yes -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 According to Pekka Niiranen on 5/12/2005 9:42 AM: > Commenting out ANY one of those 7 lines fixed the problem. > It seems I was running out of some resources > but cannot explain what is it. > > Is "$(( ))" for arithmetic safer? Anyone? $(( )) is certainly faster in bash, as it a builtin and avoids forking, but does not work under ash (/bin/sh). As long as you are happy with bash-isms and nonportable code, definitely go for the $(( )) idiom. For a comparison: $ strace bash -c 'echo $(( 1 + 1 ))' | grep fork | wc 0 0 0 $ strace bash -c 'echo `expr 1 + 1`' | grep fork | wc 41 486 3615 - -- Life is short - so eat dessert first! Eric Blake ebb9 AT byu DOT net -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.0 (Cygwin) Comment: Public key at home.comcast.net/~ericblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org iD8DBQFChKGi84KuGfSFAYARAlIVAKC+0rXLLtK52GqfhvlvoXFcUHoZmwCgmWWa 9I/N9CUpnbKLZ+Pve653SHY= =pIDY -----END PGP SIGNATURE----- -- 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/