delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2012/03/05/11:38:20

X-Recipient: archive-cygwin AT delorie DOT com
X-SWARE-Spam-Status: No, hits=-6.9 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,SPF_HELO_PASS,T_RP_MATCHES_RCVD
X-Spam-Check-By: sourceware.org
Message-ID: <4F54EBDE.9000405@redhat.com>
Date: Mon, 05 Mar 2012 09:37:50 -0700
From: Eric Blake <eblake AT redhat DOT com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:10.0.1) Gecko/20120216 Thunderbird/10.0.1
MIME-Version: 1.0
To: cygwin AT cygwin DOT com
Subject: Re: base-files: New files to fix permission issues (was Re: 1.7.10/1.7.11: .Net programs started from a cygwin console may fail.)
References: <20120302124103 DOT GB3795 AT calimero DOT vinschen DOT de> <2BF01EB27B56CC478AD6E5A0A28931F2040E0F25 AT A1DAL1SWPES19MB DOT ams DOT acs-inc DOT net>
In-Reply-To: <2BF01EB27B56CC478AD6E5A0A28931F2040E0F25@A1DAL1SWPES19MB.ams.acs-inc.net>
OpenPGP: url=http://people.redhat.com/eblake/eblake.gpg
X-IsSubscribed: yes
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

--------------enig2EB454A3363206DFA5D90081
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

On 03/05/2012 07:13 AM, Nellis, Kenneth wrote:
> From: Corinna Vinschen
>=20
>> Thanks for the review.  Like this?
>=20
> If you're open to improvements, the form
> 	x=3D$(($x + 1))
> could arguably be improved with any of the following:
> 	x=3D$((x + 1))

Still POSIX, and supported by /bin/sh (even where /bin/sh is dash)

> 	let x=3Dx+1
> 	((x=3Dx+1))
> 	((x++))
> 	((++x))

all bash extensions, so requires /bin/bash.

Also, be careful of ((x++)) - if x starts life 0, then that sets $? to 1.

--=20
Eric Blake   eblake AT redhat DOT com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org


--------------enig2EB454A3363206DFA5D90081
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="signature.asc"

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)
Comment: Public key at http://people.redhat.com/eblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQEcBAEBCAAGBQJPVOveAAoJEKeha0olJ0Nq/vgIAIs/vHyK5vmWfm03tU54xP26
VYlrDvaZY9K+06xqUXrFNy9dhnzemjBfLHmmxgdjkjmIdgbx2YZCUznWBODD8X23
GUdVDjAyOwxWu6Ad2F95Jn6nvnvc/HR0vhiCkSNFk+8pDPSrahWjbfsaDR0eUh3p
X+Tz6vhimxZgjE3m4h2oGo33zcqo9YjJJgdRjjYf28YuhZUlEIgULQZHhOKU4OO5
bUPMFxm01z7Dk1od61uZI/8qRK3RuapdoszqRTNaZNSAOTuxYqbDOrHF+OFgrLO7
o/XROyGrQnsT08zWJQN+txKc04gspXgIx2nZisn3O8dvv5gf1KgTjkrOeXtdjYI=
=3F9j
-----END PGP SIGNATURE-----

--------------enig2EB454A3363206DFA5D90081--

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019