From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-2.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_HELO_IP_MISMATCH, RCVD_IN_DNSWL_MED,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 9927 invoked from network); 20 Apr 2021 15:21:10 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 20 Apr 2021 15:21:10 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20200801; t=1618932070; b=A7cDenRp3t+2dERR281zAByNueyUyy55OhwG+YPA2ioK9HKV5EEVxArc9RnFTpZ8HNJ4ySWKhg 3f01WZYdLyfL3rq1KoTs7dp9lOyvXguKPe4dlW37PM68uTer+DYLOnc0Fz1dubzFa+FvUHvx/w 1RRWKWjtRlFYZHaSTkhzHJ2me0xfecU/iNDJXNetnF0dBNVxSEFO8buo4P6eDIahf8S6IAetZD L+OKN2U1phy+w83Muf5DfKrUd73thxq5Bie+8sh73FOsOtEzwkaR9pgWNYukBNKEee8Ec3fZO0 xav3R2dqZH/nWjUoay/X61r3V7QgaCI+MCE0DExvk91iPA==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (smtpout01-ext1.partage.renater.fr) smtp.remote-ip=194.254.240.32; dkim=pass header.d=unistra.fr header.s=CF279DD4-6F58-4C59-BB33-73FDC6DFC1E3 header.a=rsa-sha256; dmarc=none header.from=unistra.fr; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20200801; t=1618932070; bh=qH/21+osMugBuxriBTIYEcMB6eYh+qOe3sYhAEc8F0w=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:In-Reply-To:Content-Type:MIME-Version:References:Message-ID: Subject:Cc:To:From:Date:DKIM-Signature:DKIM-Signature; b=AZQPO+Qs/Qvvp5+kVff8KQCh/uZYdJk6XSEbYeZyISS5gd7JhhD4VEiioFxwexxSHp97ULMl4o 3qb2zjnSECZCo7wrMgxE+QdOFqjqpiYkPglEa8lhmjNxYQLbcRKSXobj1hW0gRarPtI1HhxqCX ks4Fxs61+oOq+5KQroUFZXt+S+h1nbrnWdgJoqEjgW+LJ/fQhM8bjot/4klZCfQAWhbpbhVkmr vSUNdqySoQoKTB6xBCu5CRzYlys3Swe/+/tnDnyFcTdlz0Zzp38o9imTyWzoqvipqrOJhj0LqL g4DrffzaN6joLtOt0ODAv0IIwQvlOOoXTDgCXgXeESUT1w==; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=zsh.org; s=rsa-20200801; h=List-Archive:List-Owner:List-Post:List-Unsubscribe: List-Subscribe:List-Help:List-Id:Sender:In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=SzLL74ehSIYeGV+0+KQUGNi3J3ohD3saw7vTQSBpDvA=; b=Rvyb9eMusdd9B834EKneq3CSR4 aAbexnsSOxARdrOM0XAZwe4IlnvlZNFKCMu8gAUd9W04lFAXQ+7klO+5WEjA+Ya97MooLB/+XeuFJ pLPfIfrAM0QTwYFsp41DN65fp64vcQcLaAHtrMn7rdFo2QhilP4efIeyPOqaXuPXPJT/F6R11wzHo HUWufUPa3/T2MXWuRsP2VP1UU5Y0AiCQ+8hkPFeFIBnWaQTMnsHsK2od/dhrBdjG8GGNvGBRTxGZF LfY5SmjrTu96kwBCtd/BNFZ4qbtaAPI9whWwUdFkPv0oAJ7Ifq6xzH5CzM8UXOcUIv36dFMS7Q93u fQteZvmQ==; Received: from authenticated user by zero.zsh.org with local id 1lYsBX-000FfF-N8; Tue, 20 Apr 2021 15:21:07 +0000 Authentication-Results: zsh.org; iprev=pass (smtpout01-ext1.partage.renater.fr) smtp.remote-ip=194.254.240.32; dkim=pass header.d=unistra.fr header.s=CF279DD4-6F58-4C59-BB33-73FDC6DFC1E3 header.a=rsa-sha256; dmarc=none header.from=unistra.fr; arc=none Received: from smtpout01-ext1.partage.renater.fr ([194.254.240.32]:52512) by zero.zsh.org with esmtp id 1lYs9d-000F1K-8L; Tue, 20 Apr 2021 15:19:12 +0000 Received: from zmtaauth01.partage.renater.fr (zmtaauth01.partage.renater.fr [194.254.240.25]) by smtpout10.partage.renater.fr (Postfix) with ESMTP id D2304639EC; Tue, 20 Apr 2021 17:19:06 +0200 (CEST) Received: from zmtaauth01.partage.renater.fr (localhost [127.0.0.1]) by zmtaauth01.partage.renater.fr (Postfix) with ESMTPS id CA143140928; Tue, 20 Apr 2021 17:19:06 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by zmtaauth01.partage.renater.fr (Postfix) with ESMTP id B9740140978; Tue, 20 Apr 2021 17:19:06 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.10.3 zmtaauth01.partage.renater.fr B9740140978 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=unistra.fr; s=CF279DD4-6F58-4C59-BB33-73FDC6DFC1E3; t=1618931946; bh=SzLL74ehSIYeGV+0+KQUGNi3J3ohD3saw7vTQSBpDvA=; h=Date:From:To:Message-ID:MIME-Version; b=IXW17CwX2DD8pHh7ZB0eqqfuotsyqQOnADSGWv0lqzh/Pajf7l+2ncJg/deXixp5q TXYJ5VBImaErY0E6H13TLuCLBmUB329aPtyHtxjM8WFJrSXVUjJmNKjGeKVC1HqguL PJtoTNcwnFUfzianb3MPjl4ja/JkOgpQN2usc9MxudSKP0K9OMjGmMk2qkI02FpSxl JlJcUTzUp2iornauyQtiWVhVZ+7UGGSEYX+FGSuVOaxenC/bAuobEGaJkjHaTeLwEz OmdiELBiBaoNMB9Zm5PmIiQJT24lFmoo51piEHhN/ENS5/BLAZTJXALgxC9uuylfjy 7DlS4VxLyokQA== X-Virus-Scanned: amavisd-new at zmtaauth01.partage.renater.fr Received: from zmtaauth01.partage.renater.fr ([127.0.0.1]) by localhost (zmtaauth01.partage.renater.fr [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id pAjhpj63JEBR; Tue, 20 Apr 2021 17:19:06 +0200 (CEST) Received: from 82.65.50.238 (unknown [194.254.241.249]) by zmtaauth01.partage.renater.fr (Postfix) with ESMTPA id 8FACC140928; Tue, 20 Apr 2021 17:19:06 +0200 (CEST) Date: Tue, 20 Apr 2021 17:19:05 +0200 From: Marc Chantreux To: david Cc: zsh-users@zsh.org Subject: Re: if (()){}else{} documented? Message-ID: References: <1154b0e1-e5ad-70be-f620-1368c86f12ed@rayninfo.co.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1154b0e1-e5ad-70be-f620-1368c86f12ed@rayninfo.co.uk> X-Renater-Ptge-SpamState: clean X-Renater-Ptge-SpamScore: 0 X-Renater-Ptge-SpamCause: gggruggvucftvghtrhhoucdtuddrgeduledrvddtiedgkeelucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecutffgpfetvffgtfenuceurghilhhouhhtmecufedttdenucenucfjughrpeffhffvuffkfhggtggujgesthdtredttddtvdenucfhrhhomhepofgrrhgtucevhhgrnhhtrhgvuhiguceomhgtsehunhhishhtrhgrrdhfrheqnecuggftrfgrthhtvghrnhepgfejjeeuffetffduieelvdffkeeifeelhfehieekgfeiudekveeuuedukefhledvnecukfhppeduleegrddvheegrddvgedurddvgeelnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehinhgvthepudelgedrvdehgedrvdeguddrvdegledphhgvlhhopeekvddrieehrdehtddrvdefkedpmhgrihhlfhhrohhmpeforghrtgcuvehhrghnthhrvghugicuoehmtgesuhhnihhsthhrrgdrfhhrqedprhgtphhtthhopeiishhhsehrrgihnhhinhhfohdrtghordhukhdprhgtphhtthhopeiishhhqdhushgvrhhsseiishhhrdhorhhg X-Seq: 26679 Archived-At: X-Loop: zsh-users@zsh.org Errors-To: zsh-users-owner@zsh.org Precedence: list Precedence: bulk Sender: zsh-users-request@zsh.org X-no-archive: yes List-Id: List-Help: List-Subscribe: List-Unsubscribe: List-Post: List-Owner: List-Archive: Hi David, > e.g. this only works as a single line (is that true?) > if (( $1 == 4 )) { echo good } else { echo bad } i'm not sure what a "single line" is. the "else" keyword should not appear at the very begin of an expression but all the rest is ok. meaning those are correct if (( $1 == 4 )) { echo good } else { echo bad } if (( $1 == 4 )) { echo good } else { echo bad } this is not if (( $1 == 4 )) { echo good } else { echo bad } > just wondered where I could read up on this? all the following examples works fine there. i'm even surprised about this one > joe(){ [[ $1 > 4 ]] && echo big || echo small } this is a math expression so i would have written joe(){ (( $1 > 4 )) && echo big || echo small } regards marc