From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17977 invoked from network); 10 May 2006 10:59:03 -0000 X-Spam-Checker-Version: SpamAssassin 3.1.1 (2006-03-10) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00, FORGED_RCVD_HELO autolearn=ham version=3.1.1 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 10 May 2006 10:59:03 -0000 Received: (qmail 57326 invoked from network); 10 May 2006 10:58:54 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 10 May 2006 10:58:54 -0000 Received: (qmail 29467 invoked by alias); 10 May 2006 10:58:46 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 10236 Received: (qmail 29458 invoked from network); 10 May 2006 10:58:46 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 10 May 2006 10:58:46 -0000 Received: (qmail 56362 invoked from network); 10 May 2006 10:58:46 -0000 Received: from david.siemens.de (192.35.17.14) by a.mx.sunsite.dk with SMTP; 10 May 2006 10:58:44 -0000 Received: from mail3.siemens.de (localhost [127.0.0.1]) by david.siemens.de (8.12.6/8.12.6) with ESMTP id k4AAwhkt009988 for ; Wed, 10 May 2006 12:58:43 +0200 Received: from mchp7wta.ww002.siemens.net (mchp7wta.ww002.siemens.net [139.25.131.193]) by mail3.siemens.de (8.12.6/8.12.6) with ESMTP id k4AAwaF4025802 for ; Wed, 10 May 2006 12:58:41 +0200 Received: from MCHP7R6A.ww002.siemens.net ([139.25.131.164]) by mchp7wta.ww002.siemens.net with Microsoft SMTPSVC(6.0.3790.1830); Wed, 10 May 2006 12:58:21 +0200 X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: quoted-printable Subject: Strange Error in let command Date: Wed, 10 May 2006 12:58:19 +0200 Message-ID: <6F0CB04509C11D46A54232E852E390AC0159C2AA@MCHP7R6A.ww002.siemens.net> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: Strange Error in let command Thread-Index: AcZ0IKWSYeyHWp3NTJ+LsPu4thJxkg== From: "Com MN PG P E B Consultant 3" To: "zsh-users Mailinglist" X-OriginalArrivalTime: 10 May 2006 10:58:21.0048 (UTC) FILETIME=[A6A89780:01C67420] I have a variable which is guaranteed to either contain a number (expressing a duration in seconds), or a number followed by the letter 'm' (expressing a duration in minutes). My zsh scripts converts this number so that it always contains the duration in seconds.=20 Here is one possibility how to do it: delay=3D20m # For example, duration is 20 minutes ... delay=3D$((${delay/%m/*60})) # Now delay contains 1200 The trick is to replace a trailing 'm' by '*60' and apply arithmetic evaluation=20 on it. No big deal so far.=20 But then I thought that this could be also written by a let statement: ((delay=3D${delay/%m/*60})) Strangely, this rises the error message bad math expression: operator expected at `m' It is interesting that the very similar statement, ((delay1=3D${delay/%m/*60})) # Stores duration to delay1 DOES work. It is as if in the former case, the occurrence of the word 'delay' to the left of the equal sign did undergo substitution as well. Is this a zsh bug, or did I make a mistake here? Ronald --=20 Ronald Fischer (phone +49-89-63676431) mailto:mn-pg-p-e-b-consultant-3.com@siemens.com