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=-3.3 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 5383 invoked from network); 18 Oct 2022 20:13:49 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 18 Oct 2022 20:13:49 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1666124029; b=oZh6n50nlU2LlK8U2FSV1nnFtpAqfvtr3mDdd0Gtg04z7i85ZkLE3+qNgLi6PFSWB5boRr0tmk sYHvGem6GV5d8001eYIc1kKZgLNxYLfloKq+BXl4l8AjtXlcTPpoN51dhvpFwKy2thVp+jecrl 0RpckrsCfNMsjMjycZO8wDGqRLgaUe9ACEXIiP8oflEU5ONsn04bZLBWaeR55itDbXx6gGyVX9 YItjiKfmso2te5MKy0R1XkOLf5EUyXEYzX/V9FeDM4pJ4DTt/N2g1EgKgHqjpE+xMf0KkkL/ar em/sSbkrZ/oH6flAOLSP3Bx9tgkdXQ2JsvDAJoWQnof5wg==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-ed1-f54.google.com) smtp.remote-ip=209.85.208.54; dkim=pass header.d=brasslantern-com.20210112.gappssmtp.com header.s=20210112 header.a=rsa-sha256; dmarc=none header.from=brasslantern.com; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20210803; t=1666124029; bh=z0EWGEhYcNfao3Y/DwK5rIDRZRMwE5qRdie9NspkHOY=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Transfer-Encoding:Content-Type:Cc:To:Subject: Message-ID:Date:From:In-Reply-To:References:MIME-Version:DKIM-Signature: DKIM-Signature; b=Wkn3p2KT7bycULVtcoZkvJVPeGfZdgMZheINevNP8FVs1IfeQciMONw9p+oJtkIJ1v56aWvaK8 uwIRaDsXoL+kBZyMuzVD7sPYP+vA7qKW+JvEwbRCvz5q+WOQARK0zFLNLl3P8rBnuBdGYw1RQj CxZuINhy0rV/8VKhSqgocQsju73iJppsxbPND0PQLQstr6TTmkf/kdbNqHXrUXIzVhrDZp3cev M/oztpxB3V+ZE0sHdyVuXfH7f5UQko+kfhpgHvW+Yk6qxoKkEYbfuXeVEOpT2C56r/NqljlKME vu4G/Ie3Arfq/h9EIaYyAYzYimBMb8lufVISurTi/EsZXw==; 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:Cc:To:Subject:Message-ID:Date:From:In-Reply-To:References: MIME-Version:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=goxE8iHYqHNDWQgAPxOYvTb+SEdFXE6tg5OpD574Db4=; b=M9OlcYuS1iYekXK5E0oJkKpdRg IWsGIp6vSDfEISCiiQwh0sD/RJ5j3q1jf3dpvrCbDxv9Hith1MsCYLQpyuFjTRC0dFCsxpBidZrPq VseArYdyecd5beiFjb6qry7YLcig+3ilwLgVp/SlXA07PVMaYmtodsRF9RxEt+iIScgpDjSUXkF2O 1pcPm2mEvGJBIAe7ONj+FFWhHu1kq8HQnlSWYBeEI1w6Mtgw5JF4pOFHOFHOVQmj63XLQ6nWfqW2C l29Q2pqvZ6KwFVSVk45OGnBKnfTyqDnRYcqxafX0yBuFoSydJD+6UX3D4xIKXlGsiXMn/EfgXpAv9 Sdxm1g2w==; Received: by zero.zsh.org with local id 1oksyD-0008CG-6g; Tue, 18 Oct 2022 20:13:49 +0000 Authentication-Results: zsh.org; iprev=pass (mail-ed1-f54.google.com) smtp.remote-ip=209.85.208.54; dkim=pass header.d=brasslantern-com.20210112.gappssmtp.com header.s=20210112 header.a=rsa-sha256; dmarc=none header.from=brasslantern.com; arc=none Received: from mail-ed1-f54.google.com ([209.85.208.54]:33341) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1okswy-0007Vn-H1; Tue, 18 Oct 2022 20:12:33 +0000 Received: by mail-ed1-f54.google.com with SMTP id a13so22228796edj.0 for ; Tue, 18 Oct 2022 13:12:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=goxE8iHYqHNDWQgAPxOYvTb+SEdFXE6tg5OpD574Db4=; b=7EVfLtsyehopV35ExfoCPR2IQnN+oTVQ4RfjQk92ESl0kK/UhBznaePEYxOmg5T2u2 5nDlx9gw/fWDxVcy5usaSnh/z4aZUQTS0uHQ8jJh9/DFiOTnuWK0bAsFE8wm6F83i8G+ +uI6pq/2iRmaE+1NIhv9nGv/YQ2lk17VsLLu2b4S/ybIwWjsqZXaUIf+S2bEgJTUUxwy DdQZBijmoEDDKDCW3JSVjTR0TGtuOoCkYZQM5q7YmQpB1zuizXuRmV4nlfPHpmX4+UBs 2BSZtf2OT0x78gq6SwoYGskuqBWxpBt2yYeZQclbgFSg3ERbkJ+EdRFtvaKro3bYqOrp Odaw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=goxE8iHYqHNDWQgAPxOYvTb+SEdFXE6tg5OpD574Db4=; b=6KFitei3rrv8jearMNkMDxrl3diWKPvLHv00Q/2uYQzUe6GM8e0TeE6hJ+jpNmeDj9 zS1iln3DoK9kw8Q9y1PXkUsWdeKuBEocvgKZg7A7DJ9rzvpuqag2W0XqGcNYM1bgbmXZ /pN4beSYPAL8dog1Q32USStMcy9CMQqza8J8If0YqhWVjajo0KLujHUua030nqeSZr+e ACdLKX9C3fUO/MjpHphuVugh3C+HoDK+MBPFHXzVjpC7TnRFT/AhSu7wgfGQdxBlTdR/ 8I5NYu0/nL6MvFAxjeNEvH9lmgDSQwHUgL8r+1Piz2fCuQcchGj1cPz4FGKZ3MPP3TTu 2XSQ== X-Gm-Message-State: ACrzQf3C6yflveLu1Q1jLKRbrD1VdR9dsRy6XdNoqMcC+XMah+/XBVnC RvBD7ntGyH85qxxVZ4f8/bpVSclXD2wH2woh8JT1Mg== X-Google-Smtp-Source: AMsMyM7Gf33mQoP5M3amJ+aXlfkJAO4GrSMjvq1IQGyahwn6/GSNryUbYu04C8waeR4oTUb8Harzuq/Xax+/4r+cbsQ= X-Received: by 2002:a50:ed86:0:b0:458:e1da:af2 with SMTP id h6-20020a50ed86000000b00458e1da0af2mr4025726edr.364.1666123952130; Tue, 18 Oct 2022 13:12:32 -0700 (PDT) MIME-Version: 1.0 References: <4b6eb0b7-ae82-a81f-6a70-784ffc1d39ff@eastlink.ca> <0ea47ef0-f039-41db-4514-b5b70045a9ef@gmx.com> <22aaa8cc-48e9-90fc-f006-e8534858816d@eastlink.ca> In-Reply-To: From: Bart Schaefer Date: Tue, 18 Oct 2022 13:12:20 -0700 Message-ID: Subject: Re: unintuitive bracketing with return value To: =?UTF-8?Q?Lawrence_Vel=C3=A1zquez?= Cc: Ray Andrews , zsh-users@zsh.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Seq: 28228 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 Tue, Oct 18, 2022 at 12:33 PM Lawrence Vel=C3=A1zquez w= rote: > > On Tue, Oct 18, 2022, at 1:57 PM, Ray Andrews wrote: > > Very well written! What breaks my intuition tho is the brackets. > > Otherwise I quite understand that the last exit value is the active > > one. I'm expecting the brackets to 'contain' the rv of any commands > > within the brackets. But no, the left > right rule applies and the > > brackets don't make any difference. > > I don't understand why you keep saying this. Without the braces > your command would be completely different. I think Ray's just got the opening bracket in the wrong place. He's describing the bracketing as if it were this: { "${${1}##*[*?]*}" ] && echo "no wildcards"; printenv "$1" } || echo wildcards present which would do exactly what he wants.