From: "Mark J. Reed" <markjreed@gmail.com>
To: Joachim Ansorg <mail@bashsupport.com>
Cc: Zsh Users <zsh-users@zsh.org>
Subject: Re: Is ":G" of ${name:s/l/r/:G} actually supported?
Date: Mon, 12 Feb 2024 12:02:31 -0500 [thread overview]
Message-ID: <CAA=-s3wbXUrFb5hwctGQjYSW5+fkNXKraLmYKM7drumKGuBY_A@mail.gmail.com> (raw)
In-Reply-To: <49716226-f212-491a-94d9-cfdb83b38aab@bashsupport.com>
[-- Attachment #1: Type: text/plain, Size: 949 bytes --]
That's history substitution, not parameter expansion:
*$ ls foobar*
*...*
*$ !!:s/o/e/:G*
*ls feebar*
On Mon, Feb 12, 2024 at 9:19 AM Joachim Ansorg <mail@bashsupport.com> wrote:
> Hi,
> I was reading about modifiers on page
> https://zsh.sourceforge.io/Doc/Release/Expansion.html#Modifiers, which
> says:
>
> > The forms ‘gs/l/r’ and ‘s/l/r/:G’ perform global substitution, i.e.
> substitute every occurrence of r for l. Note that the g or :G must appear
> in exactly the position shown.
>
> But zsh 5.9 doesn't seem to support this:
> > value="/dir/subdir/file.csv"
> > echo ${value:s/dir/_/:G}
> zsh: unrecognized modifier `G'
>
> Is ":G" actually supported or is the documentation outdated here?
> I might be overlooking something very simple, though.
>
> Thank you!
> Joachim Ansorg
> --
> BashSupport Pro
> https://www.bashsupport.com/
>
>
--
Mark J. Reed <markjreed@gmail.com>
[-- Attachment #2: Type: text/html, Size: 1988 bytes --]
next prev parent reply other threads:[~2024-02-12 17:03 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-02-12 14:19 Joachim Ansorg
2024-02-12 17:02 ` Mark J. Reed [this message]
2024-02-12 17:11 ` Mark J. Reed
2024-02-12 21:50 ` Lawrence Velázquez
2024-02-13 2:23 ` Mark J. Reed
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=-s3wbXUrFb5hwctGQjYSW5+fkNXKraLmYKM7drumKGuBY_A@mail.gmail.com' \
--to=markjreed@gmail.com \
--cc=mail@bashsupport.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).