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.3 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,HTML_MESSAGE,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,T_SCC_BODY_TEXT_LINE 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 B1A8B2B648 for ; Wed, 12 Jun 2024 19:47:54 +0200 (CEST) ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1718214474; b=a0el8M+l+X0fMKUGgPVeJ8Q7BJJBdz3QTUaH/Yu3J+CHDIgjeDwLLoDUZVKbr8EXMMXAFzT156 QR8O9iRyXZqazvzKzGkpa231Qm/6kHwdK61Rsfz9p2CfjcfWZ+WjQRLl5ZeMcq9h3qpL0fbxSE 4GUSXrjLBEZQpVEVzJFaKMHcUzLJDpbTVhSHFRrWmTvf3fmHASMneEo9Pz6QXij0kcsfkPpkcm qn12uxlbk5f71UqmUTK6I0djpvABh0OuSG97i6evLJUByy3gn5gn+f4OtuS2FF548ONklHTcQY n01GNkioR3D8h8vz0c8wKLXMDU6ebChJZPU52y6XrNnQ6A==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-lj1-f169.google.com) smtp.remote-ip=209.85.208.169; dkim=pass header.d=gmail.com header.s=20230601 header.a=rsa-sha256; dmarc=pass header.from=gmail.com; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20210803; t=1718214474; bh=84Gv08E5dX+UvO/Qt0juOMY8c3E9PuxKxBVmBzNHBDo=; 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=Qk1CnL4VG4jinUekWUIlF/BYxzEG2i4paIFl0qTM2YJivE0Nouj3ytZDCexeGapFGT/BXLN6it zRUqfoudX/5Q3eJhAD1hVj9jsjgfIi9QQU/lL/Ikq8H4VlgE5LQ+57wSxH6m3izpbSwcd6zgkN zlYJZlKtqvpQECW/QST625fg9DmsRUOPlce5uO9sllh9fXAnvJEZ4EtFgy4UGlCFlRCAyIMA4P JTDt2Cfl+yQTnDPq320aA1JLwApKVTs9p2HbdnrHVd7pndrwZduMHnBxZAMKJNDj73XWrMI+Kg MT4PvEuh0LmEszRSX1v1YlRNATxOh5UqaPISjlH7KNtFXw==; 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=I1D9uE811JM08xMniejzuo0/brLkXJ3ht+TfZvyjR34=; b=cU97Z2GThhRJ3E2MFrSO8k80BS trq3VQoVYnZE25ZD44Jy99tLEXakONTHG0LE8vlElzlPyupYiXUTEdNegjhjS58S1TAnKiSzxAbk7 jq7D+MMTYKsVCsg+0ojVdyrXY8va48QmDCBXoaZAGcOwh8gnVUt/TYb3+m3IB7iR6AIId91jIelVN 1sHA4CCLqORx16nFBDChrZYHoFhFizYgjua6IMxSp8EilIiE5cgPgUp2nG+kpwK/8f0/gcMpxxWBQ zzgwqbiCzI397f4m9NtAk1c8SS09OpuZ65HNVIwibf5NSHMefhmIlycqKK95UzRD9UZN9RRmOTdTS MyuST7Sg==; Received: by zero.zsh.org with local id 1sHS4f-000Gqj-Rt; Wed, 12 Jun 2024 17:47:53 +0000 Authentication-Results: zsh.org; iprev=pass (mail-lj1-f169.google.com) smtp.remote-ip=209.85.208.169; dkim=pass header.d=gmail.com header.s=20230601 header.a=rsa-sha256; dmarc=pass header.from=gmail.com; arc=none Received: from mail-lj1-f169.google.com ([209.85.208.169]:57393) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1sHS3x-000G9f-IL; Wed, 12 Jun 2024 17:47:10 +0000 Received: by mail-lj1-f169.google.com with SMTP id 38308e7fff4ca-2ebec2f11b7so439571fa.2 for ; Wed, 12 Jun 2024 10:47:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1718214428; x=1718819228; darn=zsh.org; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :from:to:cc:subject:date:message-id:reply-to; bh=I1D9uE811JM08xMniejzuo0/brLkXJ3ht+TfZvyjR34=; b=WlwA9xJKtTEv6CJiEsjqCBfQn8X8YJ4NReNt+AZG4qWAjiqXoWcvu1I1MJgSaYtgMj bt1bGTTWdfK4nJSaWhhu/n1t3O+CSQciGSYd6jWAYN17YBX2ITL/V29O4QxiiCdypUOP zffc6M2BVq5PtWLLRMh9yDtOe3Mkm+y9kDu4CO144u+0TnQ3IvXV5TMv70k/R45EIC3/ CL62mmDAbpzYUvr2aZfKI6TpidPnFnNZ7Xq16YckgGrXmfZy/5g7ChwRbwmtEq9ieW2n oRzJ0P0moZqlEHBm3ygnzbRDtq9cS0LPCXDfbbPl3cm2imUW4wSMBmVGmqM5Js/y0olv h8nA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718214428; x=1718819228; 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=I1D9uE811JM08xMniejzuo0/brLkXJ3ht+TfZvyjR34=; b=l+Gu1xekGX3P5mXnIvqe5qrZi+6TpUhUEJ4gNeJ3s+jTsdOVkpU3+jfhZ8m71KGQrQ AaKnAxqyFAhbkCgnZYIxhtgFLwX9RcLmwpFyEAtAL8d9sbLZoGNikok1kYS2T15y3LNl EmTrTjyt5lvTQGUg+TPYG2g/D/DrF1DwJQf5mGAVPXFByqu8WApsh0NiL9HJj2j6yq0h /qOVZHFPgnOWTqouiPE2Y00TpBA7BiUSw4rOyG+BX1zfb4l0JMXcXmeRX7KhGAZsmzUi gKCGkrR20x2WTRMCQhx/GE5GHru+Oyx2ur4xDiB5TR4kKAfLOPhAAnkTwTYJD+jTVWGH 3WmQ== X-Gm-Message-State: AOJu0YxdMkI4ItCf/6aANmJWO5Zis8SfKrTbMivakgP3O9nGgEeMeEGn T8j6R0PGROwBcSh4S2YMqEv6JzHLjc6pgjplqKS460PD5YixrmjI2U93iUiiya+vpuqoQ0aU8n6 7Y9gvzp5CaH0BFzrOMRzr0XxnZhUKPq0v X-Google-Smtp-Source: AGHT+IHo7PHI9it2zMhehhiZJ3i4JjZxFaKjn1jArK+a74yvTFKXw/mQqC8TBASQJJmsFiafW3n/dJtAjUGHDpxrKx8= X-Received: by 2002:a05:651c:1546:b0:2eb:f422:7408 with SMTP id 38308e7fff4ca-2ebfca556f0mr20755591fa.36.1718214427870; Wed, 12 Jun 2024 10:47:07 -0700 (PDT) MIME-Version: 1.0 References: <87wmmu79zu.fsf@example.com> <87a5jq73p0.fsf@example.com> <875xue72af.fsf@example.com> In-Reply-To: <875xue72af.fsf@example.com> From: "Mark J. Reed" Date: Wed, 12 Jun 2024 13:46:55 -0400 Message-ID: Subject: Re: How to delete .*.~undo-tree~ files? To: zsh-users@zsh.org Content-Type: multipart/alternative; boundary="0000000000009f0c63061ab4f8da" X-Seq: 30027 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: --0000000000009f0c63061ab4f8da Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable The usual trick works - just replace the "foo" with an asterisk while leaving the rest alone, including the backslashes: rm -f .*.\~undo-tree\~ As Andreas said, you can also write it like like this: rm -f .*.'~undo-tree~' Which ties back into those expectations from other languages that Marc mentioned. It's important to remember that, unlike in those languages, quotation marks are not token delimiters in the shell. They don't terminate the current shell *word* (what other languages would just call a "string"); you can go in and out of quotes, switch kinds of quotes, etc. as often as you like within a single word. So .*.'~undo-tree~' is still just one string, even though only part of it is in quotation marks. The part in quotes is not subject to glob expansion; the part not in quotes is. FWIW, if you want to do the same thing but recursing into subdirectories, you can use the special recursive glob sequence * ***, as in **/.*.'~undo-tree~' On Wed, Jun 12, 2024 at 9:06=E2=80=AFAM Denis Bitouz=C3=A9 wrote: > Le 12/06/24 =C3=A0 14h25, Andreas K=C3=A4h=C3=A4ri a =C3=A9crit : > > > ... because a quoted * does not glob anything. > > > > rm -f .*.'~undo-tree~' > > That did the trick, thanks! > -- > Denis > > --=20 Mark J. Reed --0000000000009f0c63061ab4f8da Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
The usual trick works - just replace the "foo" w= ith an asterisk while leaving the rest alone, including the backslashes:
rm -f .*.\~undo-tree\~

As Andreas said, you can also write it like like th= is:

rm -f .*.'~undo-t= ree~'

Which ties bac= k into those expectations from other languages that Marc mentioned. It'= s important to remember that, unlike in those languages, quotation marks ar= e not token delimiters in the shell. They don't terminate the current s= hell word (what other languages would just call a "string"= ); you can go in and out of quotes, switch kinds of quotes, etc. as often a= s you like within a single word.

So .*.'~undo-tree~'=C2=A0is still just one string, even th= ough only part of it is in quotation marks.=C2=A0 The part in quotes is not= subject to glob expansion; the part not in quotes is.

=
FWIW, if you want to do the same thing but recursing into subdire= ctories, you can use the special recursive glob sequence=C2=A0 **, a= s in=C2=A0**/.*.'~undo-tree~'
=

On Wed, Jun 12, 2024 at 9:06=E2=80=AFAM Denis Bitouz=C3=A9 <= dbitouze@wanadoo.fr> wrote:
Le 12/06/24 =C3= =A0 14h25, Andreas K=C3=A4h=C3=A4ri a =C3=A9crit :

> ... because a quoted * does not glob anything.
>
>=C2=A0 =C2=A0 =C2=A0 =C2=A0rm -f .*.'~undo-tree~'

That did the trick, thanks!
--
Denis



--
Ma= rk J. Reed <mar= kjreed@gmail.com>
--0000000000009f0c63061ab4f8da--