From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_EF,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham autolearn_force=no version=3.4.4 Received: from zero.zsh.org (zero.zsh.org [IPv6:2a02:898:31:0:48:4558:7a:7368]) by inbox.vuxu.org (Postfix) with ESMTP id 5D000227C6 for ; Tue, 2 Apr 2024 16:03:26 +0200 (CEST) ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1712066606; b=erpVoiJWiAzIV6JE9RK4/2I/O8UkQCfLWVsvWJ2VstI+DyxatQU/8fx/c0+8Gc6CeNqCRz+0rJ W9qWVLbhd9q2oOrJ1O56ioBlWRFOt8n+gEnFPxuz/cHpfkWevUCsBURG7XIFgnW/url0ZL0zN+ GA15TDzgY/byAeRX3fEb8z5v73O0QJIkVmyot4BBkXzi7KrZCCTDUvyb7lAAJ9AaZq/HxJaimb K/4g7Mp2tNcxI+03eJBObINxp0ylf2S0PAGDNcMTpleb4C5cMpd15RLbkhAUvC0unMwds0F4wo iqUZ7JXuoDyMMvuEOPptbMmQjCvgJKsgrjguSVXU0NYD2A==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mta03.eastlink.ca) smtp.remote-ip=24.224.136.9; dmarc=none header.from=eastlink.ca; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20210803; t=1712066606; bh=YKVHCZ7mHRCuuY5AxhfQoCwtNR+p8mrze0hGlAOmVzw=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Transfer-Encoding:Content-Type:In-Reply-To:From: References:To:Subject:MIME-Version:Date:Message-ID:DKIM-Signature; b=VLU1vMXM9uLshsl6Nr9PLPPCGjHtU9Fr4YBqkrR9saygeP8EQOtmr34bxPJqZjLtvek2dZ6Bla TxTbjKqdNS5dZhhPdsPoYasm/N23ttWOi2+ESTlbkaywpl2hu+1r5vmiH0E9QWUxbGidx3+Nh/ j32APnDOu041bpNFDYGxh4oVB8jqSSP55clE0Gpkj22a4Nu4DQ16OKKFmCR2lZjCkb6uHV1ZkI Bxw6HUgakycExL3QluV+u9lNtiqF/aCvLIOwPyNyK3Is81OBgT6l+obd7KmA9vRbeDTH+9Oiax IvuzM92ktMIwdJ+2/I+qYgwAudkEKNvE2nLi68/zNTvTPw==; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=zsh.org; s=rsa-20210803; h=List-Archive:List-Owner:List-Post:List-Unsubscribe: List-Subscribe:List-Help:List-Id:Sender:Content-transfer-encoding: Content-type:In-reply-to:From:References:To:Subject:MIME-version:Date: Message-id:Reply-To:Cc:Content-ID:Content-Description:Resent-Date:Resent-From :Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=koxwnVELkWHvvGrlkOdzGudTm57i5cgEAQZ0q8Ed4Lc=; b=q8iIKfbyKfBbN24TExyIhn0UzJ r3xqWFmrkI7dZOvhtECzeA/T4NbyHVds4DMwLC7Gz4nkABFXqz2NcOTMeIKu/DLIzE7UusHMGP/ud Brw+F8d8YYRFhmPx4ToVWPRJ0xa1MZTuDIuinKqSe5E0VQZLpgkw0bSAHCmW1qzkJOfifwd/c5ILn xhhI3y3kgCxkVpVnE0UwTHsocr888Qwm7AItEI5HXw9xq2PeNL/kzbHG/nx/JWHGMwHda2lALuvj2 CYTCcu2X8WZXLBUZ9NEtjlr6w1gPvfNIQ6AQBz+T+XpbwiSo8f8P5kdSByqrattrAEDHuA1JiMmdG KgsuLv1A==; Received: by zero.zsh.org with local id 1rrejW-000Bji-NO; Tue, 02 Apr 2024 14:03:26 +0000 Authentication-Results: zsh.org; iprev=pass (mta03.eastlink.ca) smtp.remote-ip=24.224.136.9; dmarc=none header.from=eastlink.ca; arc=none Received: from mta03.eastlink.ca ([24.224.136.9]:48647) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1rrehc-000B2l-0E; Tue, 02 Apr 2024 14:01:28 +0000 Received: from csp01.eastlink.ca ([71.7.199.166]) by mta03.eastlink.ca ([24.224.136.9]) with ESMTPS id <0SBB094EXIN0P4E0@mta03.eastlink.ca> for zsh-users@zsh.org; Tue, 02 Apr 2024 11:01:26 -0300 (ADT) Received: from [192.168.0.11] (host-24-207-19-13.public.eastlink.ca [24.207.19.13]) by csp01.eastlink.ca ([71.7.199.166]) with ESMTPSA id rehZr3FALAimnreharulrr (version=TLSv1_2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256); Tue, 02 Apr 2024 11:01:26 -0300 X-Authority-Analysis: v=2.4 cv=Q8Rx4J2a c=1 sm=1 tr=0 ts=660c0fb6 a=e7T7DzMKK1R988ZCg0wLyw==:117 a=e7T7DzMKK1R988ZCg0wLyw==:17 a=IkcTkHD0fZMA:10 a=evTHIEsPqDk2kcDITk0A:9 a=3ZKOabzyN94A:10 a=QEXdDO2ut3YA:10 X-Vade-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrudefvddgjedvucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecugfetuffvnffkpffmpdfqfgfvnecuuegrihhlohhuthemuceftddtnecunecujfgurhepkfffgggfuffvfhfhjggtgfesthekredttddvjeenucfhrhhomheptfgrhicutehnughrvgifshcuoehrrgihrghnughrvgifshesvggrshhtlhhinhhkrdgtrgeqnecuggftrfgrthhtvghrnhepteffhffgvdeffeelveelhfegudevkeduhfehheevhfekhfevieehjeejheefvefgnecukfhppedvgedrvddtjedrudelrddufeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepihhnvghtpedvgedrvddtjedrudelrddufedphhgvlhhopegludelvddrudeikedrtddruddungdpmhgrihhlfhhrohhmpehrrgihrghnughrvgifshesvggrshhtlhhinhhkrdgtrgdpnhgspghrtghpthhtohepvddprhgtphhtthhopeerredprhgtphhtthhopeiishhhqdhushgvrhhsseiishhhrdhorhhgpdhgvghtqdgkihhprfgrshhsfigupehtrhhuvg X-Vade-Score: 0 X-Vade-State: 0 X-EL-AUTH: rayandrews@eastlink.ca Message-id: Date: Tue, 2 Apr 2024 07:01:25 -0700 MIME-version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: unshift To: zsh-users@zsh.org References: Content-language: en-US From: Ray Andrews In-reply-to: Content-type: text/plain; charset=UTF-8; format=flowed Content-transfer-encoding: 8bit X-Seq: 29762 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: On 2024-04-02 05:41, Dennis Eriksen wrote: > > > Why not just use 'elif'? :) > > shift > while [ "$1" ]; do >     if   [ a ]; then b; c; >     elif [ d ]; then e; f; >     elif [ g ]; then h; i; >     fi >     shift > done > > If 'a' matches, the rest of the conditional won't run. > Good idea but in my particular case there's a block of code half way down the loop that applies to everything below it.  I should have shown that in my original.  Or as I have it now: while [ "$2" ]; do     shift     if [ a ]; then b; c; continue fi     if [ d ]; then e; f; continue fi     code-applies-to-all-below; more(of-the-same)     if [ g ]; then h; i; continue fi     if [ j ]; then k; l; continue fi done ... so elif won't work.  Yeah,  I should have made that clear from the start, it's what narrows the field of possible solutions. > You could even use 'case' > > shift > while [ "$1" ]; do >     case $1 in >         a) b; c;; >         d) e; f;; >         g) h; i;; >     esac >     shift > done > > The execution terminates on ';;'. >