zsh-users
 help / color / mirror / code / Atom feed
From: "Mark J. Reed" <markjreed@gmail.com>
To: zsh-users@zsh.org
Subject: Re: How to delete .*.~undo-tree~ files?
Date: Wed, 12 Jun 2024 13:46:55 -0400	[thread overview]
Message-ID: <CAA=-s3wDAH5yn=vzR=V5WndAaFp3T+UiyETZCOGy2LasGOpBhQ@mail.gmail.com> (raw)
In-Reply-To: <875xue72af.fsf@example.com>

[-- Attachment #1: Type: text/plain, Size: 1316 bytes --]

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 AM Denis Bitouzé <dbitouze@wanadoo.fr> wrote:

> Le 12/06/24 à 14h25, Andreas Kähäri a écrit :
>
> > ... because a quoted * does not glob anything.
> >
> >       rm -f .*.'~undo-tree~'
>
> That did the trick, thanks!
> --
> Denis
>
>

-- 
Mark J. Reed <markjreed@gmail.com>

[-- Attachment #2: Type: text/html, Size: 2299 bytes --]

  reply	other threads:[~2024-06-12 17:47 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-12 10:04 Denis Bitouzé
2024-06-12 11:30 ` Marc Chantreux
2024-06-12 12:20   ` Denis Bitouzé
2024-06-12 12:25     ` Andreas Kähäri
2024-06-12 12:50       ` Denis Bitouzé
2024-06-12 17:46         ` Mark J. Reed [this message]
2024-06-12 18:28           ` Ray Andrews
2024-06-12 18:48             ` Bart Schaefer
2024-06-12 21:13               ` Ray Andrews
2024-06-12 13:11       ` Marc Chantreux

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAA=-s3wDAH5yn=vzR=V5WndAaFp3T+UiyETZCOGy2LasGOpBhQ@mail.gmail.com' \
    --to=markjreed@gmail.com \
    --cc=zsh-users@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).