From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2116 invoked from network); 16 May 2005 21:00:26 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 16 May 2005 21:00:26 -0000 Received: (qmail 52312 invoked from network); 16 May 2005 21:00:19 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 16 May 2005 21:00:19 -0000 Received: (qmail 51 invoked by alias); 16 May 2005 21:00:09 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 8834 Received: (qmail 29877 invoked from network); 16 May 2005 21:00:06 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 16 May 2005 21:00:06 -0000 Received: (qmail 51006 invoked from network); 16 May 2005 21:00:06 -0000 Received: from wproxy.gmail.com (64.233.184.193) by a.mx.sunsite.dk with SMTP; 16 May 2005 21:00:02 -0000 Received: by wproxy.gmail.com with SMTP id 69so1716228wra for ; Mon, 16 May 2005 14:00:01 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=UvhFLLfc7AN1dyfL9swZRQkDAsdMkCoPcZRKIWHKpZbrihx1iz9cDzVMYNAXGN5mCFneehXOoWjOsXYxcbVgWttLPYUKpI5t/jBHZ3TyvLuErMrMPfUQnfgZs7o1cCbeVumXgbK1hq/UW2k6pZdYQcLoFpSA+bDk0sCL1X6vSko= Received: by 10.54.98.19 with SMTP id v19mr3880244wrb; Mon, 16 May 2005 13:59:27 -0700 (PDT) Received: by 10.54.67.2 with HTTP; Mon, 16 May 2005 13:59:27 -0700 (PDT) Message-ID: <3060c239050516135933fd2ff6@mail.gmail.com> Date: Mon, 16 May 2005 16:59:27 -0400 From: Mike Hernandez Reply-To: Mike Hernandez To: Matthias Berndt , zsh-users@sunsite.dk Subject: Re: Airthmetic confusion... In-Reply-To: <20050516224332.246839a4@localhost> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline References: <20050516.195529.74749456.Meino.Cramer@gmx.de> <20050516224332.246839a4@localhost> X-Spam-Checker-Version: SpamAssassin 3.0.2 on a.mx.sunsite.dk X-Spam-Level: X-Spam-Status: No, score=-2.5 required=6.0 tests=BAYES_00,RCVD_BY_IP autolearn=ham version=3.0.2 X-Spam-Hits: -2.5 On 5/16/05, Matthias Berndt wrote: > I don't know your problem, but these expression works fine here. Did you > make something special before or in your startup-scripts? Actually what happens is that the operation and assignment are performed but the return code of the expression evaluates to 1, which is an error. I tried on my machine and get the same results: (mike@mhernandez)(24/pts)(04:45pm:05/16/05)- (%:~)- (( x =3D 0 )) (mike@mhernandez)(25/pts)(04:46pm:05/16/05)- (%:~)- echo $? 1 (mike@mhernandez)(26/pts)(04:46pm:05/16/05)- (%:~)- echo $x 0 If you set a variable to any integer other than 0, positive or negative, the return code is 0, which is successful exit, for example: (mike@mhernandez)(30/pts)(04:53pm:05/16/05)- (%:~)- (( r =3D -5 )) (mike@mhernandez)(31/pts)(04:53pm:05/16/05)- (%:~)- echo $? 0 This occurs with a regular assignment as above, or if the assignment contains some variables (as in x =3D b - 4, if b was 4 the return code would be 1, yet the math is done and x is set to equal 0). There must be a reason why assigning 0 to a variable is considered an error (a reason which I could speculate about, but don't know for sure). Mike