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 27828 invoked from network); 2 Dec 2022 18:01:06 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 2 Dec 2022 18:01:06 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1670004067; b=IQcQo2ADHQrtRP+NDyWLw1r9jqLXf/qSwHFBzS44uj8u1gGa/ZBs/T2HjxNj1zYTxyg9DHykRg wGT0HeH9uxzxoNKlL1ldxR2kSJHI2SSyzvraMTbBmxmLjyFqYNFK+3Pz593EyOzHaSY+hgeYVv 9AREWzBxQYSgRwG8F3MkP5Wur6TAeZTLccTibxVnu1C33Hw+cf56eDmNy/InQ1R+2jOjBtAKof 30Gq/PSM5aWvXCrLxsGQRvYw46cfcSEh9eY+P+aqcm7wG+Lw+OJy1Z5OcUMA6QZFtEqAlvd5Tq QIlirsxuY56ZCwAPD3hIrfYUVaJ4LgQoNrIjDOBWP4UYAQ==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-ed1-f50.google.com) smtp.remote-ip=209.85.208.50; 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=1670004067; bh=DgW2DHj7UT0R3c6n63fnXpX1PArRILP2bmvqU7PYMB4=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Type:To:Subject:Message-ID:Date:From:In-Reply-To: References:MIME-Version:DKIM-Signature:DKIM-Signature; b=KK2oZPccEjpLy4dQtzj4LC1Z2VzxMskYOEsK6m0AFFqIr7Sfx7eYcrzcFjESgkTf8LXEhSQ8E2 6uoeKKH/qmDLmEo2EC41IGBVqMCbxrgLU87FmU+hNOY6r2gj+YJzr/rAzYDKbPdNTWTUFrJHYf mA7nXm8Ka61INr3moUXFsP74y6nUIHwg/MvER48qJoeTeqFTdvWVVqfF3FBMIYtTABL7KM6/U+ ov/1x2WBlXc8UFXGGpZXpVvVCViXsV8i3BYUqB6qSkBlqobsy993WK7BMvpkzlVVGk07ILOhe7 i7LH5cKJPHm9EG1oIGkuzshjAYlXkSnEqyLfE5FoKwZVTg==; 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-Type:To:Subject:Message-ID: Date:From:In-Reply-To:References:MIME-Version:Reply-To:Cc: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=O/SiRlX92zy9aol//v6vBW+wMlHC7ABmfhWYKYZmKBE=; b=LNUu/lOWlTPkw5iQLAR7yiu9sh w/W+9gnYbn+c/LuyCxuIv61OCbU0w55fP8rHIu3XjPxtsD5EK78E0mg03NCmR065OPNgqLhsEUSRd nFIvcIwLZ6ojcnIuShWBwlX1IAo+5U7Gm1EsMPvOqSA1U/z1PQX5EXu2d22HnoNWC6XPcTmki1O7E cpPYXcKjN9ukNhY/lxcD5UF4l9pyI8eZDMaiqj5SViy3gJNFv7SjDhoS400ci5jhzkvVtI1YvtU/b I9tFHbojRoVFA1xPv2CLndbccZwrT8V09ul5YQMPLT32FwFAPRV+0xGBjqwYPU9A0ig+S7WVejn0J iMwgFIKw==; Received: by zero.zsh.org with local id 1p1ALS-000GTt-Io; Fri, 02 Dec 2022 18:01:06 +0000 Authentication-Results: zsh.org; iprev=pass (mail-ed1-f50.google.com) smtp.remote-ip=209.85.208.50; 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-f50.google.com ([209.85.208.50]:33654) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1p1AK5-000FNl-7J; Fri, 02 Dec 2022 17:59:49 +0000 Received: by mail-ed1-f50.google.com with SMTP id d20so7543430edn.0 for ; Fri, 02 Dec 2022 09:59:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20210112.gappssmtp.com; s=20210112; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :from:to:cc:subject:date:message-id:reply-to; bh=O/SiRlX92zy9aol//v6vBW+wMlHC7ABmfhWYKYZmKBE=; b=MBkuOg3ce8s86fXEt0+/2Yz/+ABQzxT11NGdcAU8wBrIMVkQXNvgBMKv6isPhDc5X1 2rFbx3B67tuSGvW/6OoVyI3Hgi/LNkfFGNfbvwrRQK9Q/mST56vSrO9AEef9cxTMhxnG 5zUxNYrDPZqTvPtgCJQcrS8Yf3hlJWLo0mI8kdKxEiSeDZ//EQLU6yyCTsk6sN8sr5oH Tmaf4y1tgXexXLxH5BlF16r2CtNr81OG8xIN9bE4EtvSwlDwrPHBt2DED3O89FXBDkkF uLfI5kx/N4Ze7QGVPiX43cFszR3BQHyRNAUkd40kBqROvhNyqIJcI0bOESBDfMrZXOhW pdGg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=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=O/SiRlX92zy9aol//v6vBW+wMlHC7ABmfhWYKYZmKBE=; b=rEae0Qzs2vaNAvwLqoP4BaPaxzyT9ojAl3N6Gx7OsYywpf1BodN8C/IhVfChM2INgI WDuELzCvAgGS/kqDKQYVZ94lhJO/ojVhPc2pnJPsOdMIOvz3AqHTFlpfsjum6kV8EgZq d8tnBBsjb2k5TT/rC3rusCBbDmbVL2qezejJGE6MDyQm8qNKYoZaim42Rpc6to5fCv4l eqoLTqG45oc7UiUjbmLL5h2lemVxb7YwZWCIfEkw8yCHXgPvGfm+TzBeGBQYKrlczYbf k5H0BtWdOu1voUKHqE9/j+TsSqWMaM/0j9hbkU2mjSG6FFpWqoIrT6ZFsNXMihn3Ec7Z eFkQ== X-Gm-Message-State: ANoB5plPKKFYIXD4CC7TgZk6Xy4aeYrTcnVhUtvHZRuj3mZG3EbSW8O2 E5DlldbVZ4XMMmnXgSjS0EGiuI1eBvapL+cDTSMVkg== X-Google-Smtp-Source: AA0mqf5JUpcUZvppw9Uw6zNgHHBzz3PQyTFpQbcWeilpVA8SQyVyhRGN9+6Ty7PjjIsHl6KnR9cuwHarkZFF4Fddxg8= X-Received: by 2002:a05:6402:4507:b0:467:205b:723d with SMTP id ez7-20020a056402450700b00467205b723dmr6852730edb.69.1670003980494; Fri, 02 Dec 2022 09:59:40 -0800 (PST) MIME-Version: 1.0 References: <1dcdd69c-ce29-921f-f0f0-6862f68b62a6@gmx.com> In-Reply-To: From: Bart Schaefer Date: Fri, 2 Dec 2022 09:59:29 -0800 Message-ID: Subject: Re: Modifiers and parameter expansion? To: dominik.vogt@gmx.de, zsh-users@zsh.org Content-Type: text/plain; charset="UTF-8" X-Seq: 28475 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 Thu, Dec 1, 2022 at 6:48 PM Dominik Vogt wrote: > > On Thu, Dec 01, 2022 at 05:34:18PM -0800, Bart Schaefer wrote: > > Not sure where you came up with that. > > [Implicit: the braces can be omitted, unless] OK ... but that didn't come from the context in the doc, which uses the form with braces ${NAME} as the base case. > (The implicit statement is the _only_ "mention" of the brace-less > form at all.) "with or without braces" is explicitly in the last sentence? But again the manual is largely written from the viewpoint of someone who knows how shells work and therefore is familiar with the $NAME case and needs to be told the way zsh might diverge from that. > > ${=X} > > ${~X} > > ${#X} > > ${+X} > > These work without braces even if KSH_ARRAYS is set. Hmm, I would say that's a bug, then, in "emulate sh" if not in KSH_ARRAYS. $#X should be interpreted as ${#}X (and is, with "emulate sh", even though there's no specific setopt controlling it). Bash doesn't even attempt to expand the other three, they're treated as not being substitutions at all; you get an error only on e.g. ${+X}. I suppose allowing them to work without braces is an extension in the same way that supporting them with braces is an extension.