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] |
On 03/05/2012 07:13 AM, Nellis, Kenneth wrote: > From: Corinna Vinschen > >> Thanks for the review. Like this? > > If you're open to improvements, the form > x=$(($x + 1)) > could arguably be improved with any of the following: > x=$((x + 1)) Still POSIX, and supported by /bin/sh (even where /bin/sh is dash) > let x=x+1 > ((x=x+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. -- Eric Blake eblake@redhat.com +1-919-301-3266 Libvirt virtualization library http://libvirt.org
Attachment:
signature.asc
Description: OpenPGP digital signature
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |