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,T_SCC_BODY_TEXT_LINE, UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 18033 invoked from network); 14 Sep 2022 18:38:08 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 14 Sep 2022 18:38:08 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1663180688; b=lXU/xuiyeiPz7EfcDCsDocGz2VVGXU9ELv9xaRmgsy+PbLDAZKxVJOFJkooeSjpcl+Vcp5kjRT Ii9/gF3oWLtloF3AmPxpUirxsHOnLRIsA8o4bG15bYIzW6u17H1D05yk59jw4EWnlOLrqQgCqi AOVzfvCCKRuAlCrnHZ0UmPU5uwNxaWpYo1kbGMwhDik4JCRcCow5g/vFmxF+/OPZ3h9MAChTeC PD5eD0CljfA2gS8UMVFLdjzrbCgAJM1k2JRfQyGQa+tzP38fwdOMOpGaMoBaOwxG5uzwumqSDh jAnXBq79ZbXFU/U6AIzin6MtthS5WmaJMaD5rojkhxt/ig==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-ej1-f44.google.com) smtp.remote-ip=209.85.218.44; 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=1663180688; bh=ZdK5u/O1GQpv0hO6x/0YqyPA7+0sU6hZ0/KOqygLWjs=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Type:Cc:To:Subject:Message-ID:Date:From:In-Reply-To: References:MIME-Version:DKIM-Signature:DKIM-Signature; b=fRjCXl62bmu6kb5hfmsYQOCmxEM0OLBuBr35aW5DYefkV4aOroRzyB/BOx7I4YFIWlCYaQNas4 svmVmLVJ76VSZnjy5DHFUMpn58fjbmo7npj05xNFE6r0kxmV8SP4tKOgBzG+h+9cxdTDu1Yxwm 0aEI/9KEJGK7oFRZSQnfcVSHJFMq0fLnmrmujZSwWBSRgEUAFoZFf2rytWmL8tl5h5lWQjanHP wvWQlTTynkOnKNJ8ddEOfkT2V015xFnHnUNQ4At/FleMVqKABAtyVMmv5Dlt41cv8inCJfgOcZ +wn6ZdK1uwlc0KT6ApQETIjNDTjj7fh4yt9h5XIuX4F0JA==; 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:Cc:To:Subject:Message-ID :Date:From:In-Reply-To:References:MIME-Version:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=pmdejsNiL5sr1FO9rxv5YszID8R/RJr1EjIPiOGIDt8=; b=g8B+AjedQbzw5bjdVIeeDmuCNS hOq7pQAri1a11G50yN2541PRzFnBErCIEzw4HGw+ZW+ysRPRufukbgvSR+6EismnkVWdN693Mu/Ws M2Db65U2gPMTVYLFSy9HiuIhaPSlU0ppPBeBq/1iHMCKthjs8mYjRL8JS+Xda3BoVzGWegQT0fIG+ nzPdR9DYsDqg+Ejhpi0pDfRtZT0NHQjQ/5tfcHaeigtC+HXEIpBSUM6CpemtvmjmGcbILUCIv0lpl t5mY5qWguXjrrYAlzSVNfXcICeLbFwU47exxUZYTCYrEuEdF8CkmhQQq22FTpSgEZobkyxe4qNPqD LsQAO2ig==; Received: from authenticated user by zero.zsh.org with local id 1oYXGy-000N4y-AS; Wed, 14 Sep 2022 18:38:08 +0000 Authentication-Results: zsh.org; iprev=pass (mail-ej1-f44.google.com) smtp.remote-ip=209.85.218.44; 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-ej1-f44.google.com ([209.85.218.44]:45729) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1oYXFi-000MNC-Oc; Wed, 14 Sep 2022 18:36:51 +0000 Received: by mail-ej1-f44.google.com with SMTP id dv25so36776723ejb.12 for ; Wed, 14 Sep 2022 11:36:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20210112.gappssmtp.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date; bh=pmdejsNiL5sr1FO9rxv5YszID8R/RJr1EjIPiOGIDt8=; b=VB8o4rBj4WBD0gJl6UGi2KMAN95enDkHtQXSFgnQNv/u6gWCKFWT2U8fK9d0ls6W/S 16++7s1uoP+iCf4LoFFN1osEywuQkyBoLvpknifv/fBtdFwxLn3Ixsq7MH6zV0cqDtgG SsWYh8v2qA7PrD4Olc5HEfTYUlZ8C5PG/Qm8hae6poCgmNdlmcmirA+/zyOLtynXHsqY 2cWosKV5s562aEBJEmQ/7qT5CDQ896bPV40XPEDVGPJxE+z7vB7bk10f8RrbXT+neepR 5E0pZPIJkSpZwbMmyfmuvPkbFnhplhm2C8BMoblv8fBVLTWfQsYQ7CUihmAVw7qYsVZW eVDw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date; bh=pmdejsNiL5sr1FO9rxv5YszID8R/RJr1EjIPiOGIDt8=; b=Y3MHcdtqeq+vkZOxmvBDy4tzZSqNw34xjmSEL6AdV/ZY7UPSQtXHy0SxqXyHYs1K6j Xr/Qmw28KHPeQGaGoHseATW3DZZYpd9cT8RCXuD/PFSvDVXSY4znNr0QGHFgwHtDZfLK hKsHOfWp9+y65vdwX9kNm2jBDwWjJTbBy9BtxN+s7udI4wGiMH4Bvniwztib/wFChYEY 1bS9CwCVawmLWnNy5IepqtlIsokq5sWMJEtowVvvofU8wE72X92+m8AsEFvz+Mzx0Mn0 oHmNIhMVKQoRJa4h7uLiecxeAqTTmpGVEiE2kdUnHVeS+A+H53KTAvmOTU68Y+4Jj8v0 5gOQ== X-Gm-Message-State: ACgBeo0IHjXgZHZlsR2ZQN9iq1wgnfXdA4WNeZQ5bIIkVcq5Ofa8fymJ uhncLd6LXCzbmEPG6XOn/IedQuS9kIj0Hfyd+GpbZw== X-Google-Smtp-Source: AA6agR7B48VCEsizCetP+mznr3YSYGERO08QCr/b3YJDp8PrkEo1PP1CQlXfK1YvCLOHxNxgHuboBNsY/E97ghrGsqk= X-Received: by 2002:a17:906:fe09:b0:73d:90ae:f801 with SMTP id wy9-20020a170906fe0900b0073d90aef801mr25178642ejb.699.1663180610139; Wed, 14 Sep 2022 11:36:50 -0700 (PDT) MIME-Version: 1.0 References: <5dc8b935-f234-ca54-0ceb-50cb1da9bc29@rayninfo.co.uk> In-Reply-To: <5dc8b935-f234-ca54-0ceb-50cb1da9bc29@rayninfo.co.uk> From: Bart Schaefer Date: Wed, 14 Sep 2022 11:36:38 -0700 Message-ID: Subject: Re: Can I test if a parameter expansion has worked To: zzapper Cc: Zsh-Users List Content-Type: text/plain; charset="UTF-8" X-Seq: 28070 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 Wed, Sep 14, 2022 at 9:52 AM zzapper wrote: > > Q1) Can I test if a parameter expansion has 'fired'? I'm not sure what that means. Does 'fired' mean expanded to a non-empty string, as in, the parameter has a value? And, test when, relative to the placement of the parameter reference? And, what do you want to do based on the result of the test? The most obvious answer would be that ${param:?} will cause a fatal error if the parameter is either unset or empty, but that doesn't provide any avenue for recovery unless you use an "always" block around it.