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]

RE: Variable not set correctly in bash


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@cygwin.com [mailto:cygwin-owner@cygwin.com] On Behalf
Of Brian Dessent
Sent: Mittwoch, 13. April 2005 08:03
To: cygwin@cygwin.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/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]