From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: zsh-users-return-23700-ml=inbox.vuxu.org@zsh.org X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from primenet.com.au (ns1.primenet.com.au [203.24.36.2]) by inbox.vuxu.org (OpenSMTPD) with ESMTP id 1ffcee1d for ; Wed, 3 Oct 2018 20:55:18 +0000 (UTC) Received: (qmail 25679 invoked by alias); 3 Oct 2018 20:55:06 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: List-Unsubscribe: X-Seq: 23700 Received: (qmail 23623 invoked by uid 1010); 3 Oct 2018 20:55:06 -0000 X-Qmail-Scanner-Diagnostics: from mail-lj1-f180.google.com by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.99.2/21882. spamassassin: 3.4.1. Clear:RC:0(209.85.208.180):SA:0(-1.9/5.0):. Processed in 3.276891 secs); 03 Oct 2018 20:55:06 -0000 X-Envelope-From: schaefer@brasslantern.com X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=JNyW/dLlPzqSUTaznVH2es2D6WiiLQiGbdhQ4EgJapk=; b=Afw717TDIcKRW9GfI91GXh4vtVmXCG1fX+n7K9RVnHUQN8VqMOugDRwhfkLGpv4uXO JaO0J2iXwIoeR1oSKf2u8w0VdTZ1+MyTWxzPXpsE3/6EOCQ33Z7oAZPLwcwQliMtzZFI kLq1HPmQO0ZHDfZBk62++aOxSVhiKqZay6R0r5pHJxfDa8T29q2XZPU5Und8QFPZ3A02 QsY6q+nj6SHqIy/K7tQ4YMEeZIrYh0lwU1jW7biZ1zNNO0sVwLd98o2a7rz4OTkxN21t Lp0ZxcEzg20UlQPDcOLQQcNbMIe92jWfUYf1mHooiTW6KJtKDy7xTl8DoI7EPBLOw0vT SE2g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=JNyW/dLlPzqSUTaznVH2es2D6WiiLQiGbdhQ4EgJapk=; b=Ho7O/2GLoLCVRf7yPHkVvEcEMvdhcJiEb1LkpGCe6zc5DvInXEeO9B5W7LTVKcUsEc zslql2s2yRyEbjO6Wi7xYD6Sy9aZIQJ7BCJJ4azMkEl28+M1ow9Rqg4MULz9ui44UnGg cY8HVowyuueO+Ytk3RndPQF/EDhk1hq58p+l4W8EfDt6QOru2nnNKdE2ETLSXPMWt/kX zBvjcSE3oDcNr6oG0X0IspORw3pz6Nwf13swstybLTuM1X/G5EOn3pn3T4f+mkGPQ1nZ /xPR91a5a7kx3JBBBIIzVcphIxZrPgIGlzgSSL4RhWJkNbwPt9vNZgTIK6MqPZVLSRpi DPFQ== X-Gm-Message-State: ABuFfohcF/A62wuCd2kobkPdjaulXwWGgf6ksHLJjht+j6HsfyFjzxYj zPfkBndvc4sGF3MZd6mVaX48L6EsgcjRD5f1zVR+X5sF8l6/+w== X-Google-Smtp-Source: ACcGV613aWiKmaT549pnwKDIf3FlCxm1yMhSgPy3g57Y9ap/nkNTQhkuHNtYop1TWLIHqzAr/JtQgtcD6SOm54NoprQ= X-Received: by 2002:a2e:91d3:: with SMTP id u19-v6mr2157665ljg.64.1538600097918; Wed, 03 Oct 2018 13:54:57 -0700 (PDT) MIME-Version: 1.0 References: <20181003143800.GA9162@prometheus.u-strasbg.fr> <20181003162552.GA14697@prometheus.u-strasbg.fr> In-Reply-To: <20181003162552.GA14697@prometheus.u-strasbg.fr> From: Bart Schaefer Date: Wed, 3 Oct 2018 13:54:46 -0700 Message-ID: Subject: Re: dangerous behavior of while in zsh 5.6 ? To: Zsh Users Cc: Marc Chantreux Content-Type: text/plain; charset="UTF-8" On Wed, Oct 3, 2018 at 9:26 AM Marc Chantreux wrote: > > i have the same behavior when interactive but no syntax error otherwise. > > instead: > > { repeat 2 print $[i++] > while (( i-- )) print $i > } |sed 10 | xargs This shows a critical missing bit of detail from your original message: The while loop is inside a { } expression. The parser treats the close-brace as terminating the loop with an empty body. If this had been in a script file with end-of-file at that point, you would have received the syntax error. % { while false cursh while> } % This potentially does indicate a parsing problem in 5.6, because in 5.0: % { while false cursh while> } zsh: parse error near `}'