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,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 16352 invoked from network); 8 Jan 2021 22:26:34 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 8 Jan 2021 22:26:34 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20200801; t=1610144794; b=WzueGIDF5i/RFu4A/OeqzvkHYLQIbNUrjDnOv6QX7ZZvVqsFz7eIftI/cKJVw2MP9n9C1Wrn+v UhBUjFN56yi2seO7xJY8hDKkIycc1VVLTu5nOL9BDTgGTe+8ibg/P2PV8NF06o/7BI9sUICM7m vYViEh+2fa5nHm4NaPiqnWVRKm58ljwA9QdzdNpac2ekaxr9DVmTun7UDshvldiqNaKJFMATtA BKTgyMwa52UycgheSHkV0m7ZxkEtoFd2VS8un+WmoaB46F2lK2gThwykAeZaRy+7C0CrtINxdc U8IaJpj1/w7EbJ6hwAEsRA2fpJUEEYozI1RSsr/y4z+82Q==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-ot1-f43.google.com) smtp.remote-ip=209.85.210.43; dkim=pass header.d=brasslantern-com.20150623.gappssmtp.com header.s=20150623 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-20200801; t=1610144794; bh=bA0yxSMcq24/tELZPTEPY6Js9z6ygWbUwlYPu1jKrXk=; 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=TIh4H/CzuUqimASUX9WK5RAnjpEP6IPptgmAPYl/MkvjJG42XYiBqIc/j562dMB3ch1cvhYwh8 JrPyb0KeNO33tZHfW42pt8IAKqphqM09uaUZBHJMr31VigmVvatyYyiSwz51lxCuEUxX44X3/y 0z9slVPSOXMDGQLmjPxWBaV5+Vy0p6g3q+iNgkmV8KCn5PVm/zDCjkgb7Tgmq7/X7WXC2lSrfu LGJqEqIyiUhBYcHdDp0l6mb1gYQG7A52f49yPEKS/gCnsta+CoxE0d3HTb2M+d6haha4mRjDeX /tkOA+UzAQlcQdVsZXIMX32l0gifnsxysMEYagkf+vLsWw==; 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: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=UkAa/V/u/ABGZXeZO/TuYIZYqMcu9wfyLmPhEBijSrY=; b=lXPwR6AnZb51N6yjAU0JV0hiy8 JkJKZWQ+VV4bBDt7WbibbRtqQprf7aa/fDLYVYl1DowCxMuuopv4Q6g3erOISr7n7Kh2zgMyb2Zzu fU4mrd6YOUGVohy6pbdOuA1KMcTUetCnmU1gZBJySDm5yFMRvBJQlmVLVmz1xwTTDcVmeVJ4qHygA ntCv+JSzgUPZNvkPbs9hAxLZfU9v65e3t6PC7k2nViWRAYZ9I4ztxhv+ol2iFpASZxkQ8bpq/Iid+ cQ/KloOUKd0YKayrLUuS7lXCUzaHN4tbnCDWFnPTaJWSfkTszQROfrXLwMoy6lWbYhuzEy2/oKnHD zA1wr5sQ==; Received: from authenticated user by zero.zsh.org with local id 1ky0DH-0007ZM-9R; Fri, 08 Jan 2021 22:26:31 +0000 Authentication-Results: zsh.org; iprev=pass (mail-ot1-f43.google.com) smtp.remote-ip=209.85.210.43; dkim=pass header.d=brasslantern-com.20150623.gappssmtp.com header.s=20150623 header.a=rsa-sha256; dmarc=none header.from=brasslantern.com; arc=none Received: from mail-ot1-f43.google.com ([209.85.210.43]:34720) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1ky0Ck-0007Cp-AM; Fri, 08 Jan 2021 22:25:59 +0000 Received: by mail-ot1-f43.google.com with SMTP id a109so11246180otc.1 for ; Fri, 08 Jan 2021 14:25:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=UkAa/V/u/ABGZXeZO/TuYIZYqMcu9wfyLmPhEBijSrY=; b=PeGd+EWHfk2rcQs1BC2AKSzhZfjgy31cvtQcdbgchn23HixgFPyVgLaihEwicLeYV3 0EKt1D3JhBK+1Mikq/sMswJmUxwK2t1iE40PXKrT5uzOdH4C7UQu86ai0gUDPFmQVd4y oYOWQGNz/Y3W4pepM805x5pD19Yi+Fo66TDeBFix3759zpzaO2lFXvyVqa7YXCGv9uv5 aBOL2a8kHEveWrOXoKPwT/09MsiKRblI1qyb52vYQWqNXYCg2zvHiJUTJ4pTCCRvi8dG LkpAsPQzPpT9gnemmVsLbWvjpDS06e6OAj/8KYhWlVxCLGeSutrE+XLHl7SZiTy9Eor7 dP7Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=UkAa/V/u/ABGZXeZO/TuYIZYqMcu9wfyLmPhEBijSrY=; b=Wkmibk4m3qkvsrB+rwvNquw73eMJeGP5E+9yJ/VouTJB8PxZtFjAzB1IOCp20qzbHu odbSTUob+NGVG6W+D+7d0qaN/S6hOoXdLfjamKp9Ih/lg11axw1QrIlnnqs1yX2bBEYp qosi+9dzHXhW3JDYwGbcrdsEFCu+ruUnJ67CnP4DDHj8H/sGU1gjc+dSiH5MDLQkCpyd QeMLRHq0EbP4OSOECC7tG5YDIM4D/zsxXviRh319ye8eiTZQ9C2+FBBF4HJuw9Gye/Pe wn24PcbKskRW7yN7vK145nFWehjhMBpUjnFWpjd1NeGwF84qbWOed+66SjLS3mZOlsNP ngjg== X-Gm-Message-State: AOAM532n1Bowl5p7HGQkzp/0c0DFHtD4kRtdnEjZ7bS2OM/cHgcFOgPv wHb2Jh+7txwu7EqchiA5Hig5UUL8AWxTcnoP3Kg33czB7vb1e8ki X-Google-Smtp-Source: ABdhPJz9lL+ZAl7eeCqCghmiZ7G2h3GC2XcsSijUgCr8BMq64r2ri3FGSl0mOf9v70N9GpM8DnWbSUINr04jeWeIMMA= X-Received: by 2002:a9d:470c:: with SMTP id a12mr4013121otf.161.1610144757035; Fri, 08 Jan 2021 14:25:57 -0800 (PST) MIME-Version: 1.0 References: <6B1D00CF-E282-49D3-8ABE-88AB8EBED62B@covisp.net> In-Reply-To: <6B1D00CF-E282-49D3-8ABE-88AB8EBED62B@covisp.net> From: Bart Schaefer Date: Fri, 8 Jan 2021 14:25:46 -0800 Message-ID: Subject: Re: Parameter subsitution To: Lewis Butler Cc: Zsh Users Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Seq: 26353 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: Archived-At: On Fri, Jan 8, 2021 at 2:02 PM Lewis Butler wrote: > > The s/l/r/ substitution works as follows. > [. . . ] > * A null l uses the previous string either from the previous l or from th= e contextual scan string s from =E2=80=98!?s=E2=80=99. > * Note the same record of the last l and r is maintained across all forms= of expansion. > > Does this mean that l is recorded until the shell terminates or until a n= ew l is used? Until a new l is used. > Is there a way to see what the current l is set to? No. > $ file=3D"/usr/local/tmp/filename.txt" > $ echo ${file:s|e|3} > /usr/local/tmp/fil3name.txt > $ echo ${file:s||4} > /usr/local/tmp/filename.txt > > Doesn't look like the l is maintained? Works for me: ubuntu% file=3Dfilename ubuntu% print ${file:s/e/3} fil3name ubuntu% print ${file:s//4} fil4name ubuntu% print ${file:s||5} fil5name ubuntu% > And where is the !?s syntax defined? History expansion, under Event Designators. > Any examples of using !?s in anger? What are you talking about!?