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 X-eSCM-MailFrom: Content-class: urn:content-classes:message Subject: RE: Variable not set correctly in bash MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Date: Wed, 13 Apr 2005 09:22:31 +0200 Message-ID: <86B406A17C3F684CB66499B87361FB3802D8FE@mail.dieball.net> X-MS-Has-Attach: X-MS-TNEF-Correlator: From: "Andre Dieball" To: X-IsSubscribed: yes Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id j3D7Zlmp003199 Hello Brian Thanks for the hint. In fact, I'm calling explicit bash with "#!/bin/bash" in the scripts. I'll try you're workaround anyway as soon as I come home. Thanks. Andre -----Original Message----- From: cygwin-owner AT cygwin DOT com [mailto:cygwin-owner AT cygwin DOT com] On Behalf Of Brian Dessent Sent: Mittwoch, 13. April 2005 08:03 To: cygwin AT cygwin DOT com Subject: Re: Variable not set correctly in bash Andre Dieball wrote: > NEW=$[ $OLD + 1 ] That construct is a bash extension that is not part of the regular bourne shell capability. On linux, /bin/sh is bash, so it works. On Cygwin, /bin/sh is ash which is a more basic bourne shell that does not have all the extra extensions that bash has. In other words, by doing that you're limiting your script to only work on bash. You can either change the shebang to explicitly call bash, or use a more portable construct, such as NEW=`expr $OLD + 1` Brian -- 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/ -- 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/