zsh-users
 help / color / mirror / code / Atom feed
* Substitute the last match of a pattern during parameters expansion.
@ 2022-09-12  4:20 Michele Venturi
  2022-09-12  6:01 ` Lawrence Velázquez
  0 siblings, 1 reply; 24+ messages in thread
From: Michele Venturi @ 2022-09-12  4:20 UTC (permalink / raw)
  To: zsh-users

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

Hello, I have a problem, can you help me?
I would like to substitute the last match of
a pattern during parameters expansion…
The string aXbXc should become aXbYc;
I have not found a direct and general way
of doing it, but there are some solutions…

The problem is that they are cumbersome:
${str%X*}Y${str##*X} is too convoluted for
such a simple operation in my opinion, no?

Hard-coding a number like in ${(I:2:)str/X/Y}
is usually not a good idea, don’t you agree?
Other possibilities have similar down sides.

So is there an easier way to get the desired
result or should it be added to the software
and how complicated would be to change it?

I would suggest a new flag like % or $ for it.
I wonder if the syntax ${(%)str/X/Y} is going
to conflict with other functionalities of ZSH…

Obviously adding negative indexes support
to the I flag would be very good but verbose
for the most common use case of that, right?

What do you think about this whole matter?
What should I learn to find out how to do it?
Your thoughts on the topic are appreciated…


<https://about.me/dardo82?promo=email_sig&utm_source=product&utm_medium=email_sig&utm_campaign=gmail_api&utm_content=thumb>
Michele Venturi
about.me/dardo82
<https://about.me/dardo82?promo=email_sig&utm_source=product&utm_medium=email_sig&utm_campaign=gmail_api&utm_content=thumb>

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

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: Substitute the last match of a pattern during parameters expansion.
  2022-09-12  4:20 Substitute the last match of a pattern during parameters expansion Michele Venturi
@ 2022-09-12  6:01 ` Lawrence Velázquez
  2022-09-13  4:19   ` Michele Venturi
  0 siblings, 1 reply; 24+ messages in thread
From: Lawrence Velázquez @ 2022-09-12  6:01 UTC (permalink / raw)
  To: Michele Venturi; +Cc: zsh-users

On Mon, Sep 12, 2022, at 12:20 AM, Michele Venturi wrote:
> Hello, I have a problem, can you help me?
> I would like to substitute the last match of
> a pattern during parameters expansion…
> The string aXbXc should become aXbYc;
> I have not found a direct and general way
> of doing it, but there are some solutions…
>
> The problem is that they are cumbersome:
> ${str%X*}Y${str##*X} is too convoluted for
> such a simple operation in my opinion, no?

Lots of tasks could be reasonably described as "simple".  The shell
cannot provide succinct solutions to all of them.

> So is there an easier way to get the desired
> result

Here's one approach.

	% foo=aXbXcXdXe                    
	% print ${(*)foo/(#b)(*)X/$match[1]Y}
	aXbXcXdYe

> I would suggest a new flag like % or $ for it.
> I wonder if the syntax ${(%)str/X/Y} is going
> to conflict with other functionalities of ZSH…

There is already a '%' flag.  I do not think this merits a new one.

> Obviously adding negative indexes support
> to the I flag would be very good but verbose
> for the most common use case of that, right?

Extending the 'I' flag in this way would be ideal, if possible.

-- 
vq


^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: Substitute the last match of a pattern during parameters expansion.
  2022-09-12  6:01 ` Lawrence Velázquez
@ 2022-09-13  4:19   ` Michele Venturi
  2022-09-13  6:06     ` Lawrence Velázquez
  0 siblings, 1 reply; 24+ messages in thread
From: Michele Venturi @ 2022-09-13  4:19 UTC (permalink / raw)
  To: Lawrence Velázquez; +Cc: zsh-users

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

On Mon, Sep 12, 2022, 08:01,
Lawrence Velázquez,
<larryv@zsh.org>, wrote:

On Mon, Sep 12, 2022, 12:20,

Michele Venturi,

<dardo82@gmail.com>, wrote:


> > Hello, I have a problem, can you help me?
> > I would like to substitute the last match of
> > a pattern during the parameters expansion:

>

> the string aXbXc should become aXbYc;
> > I have not found a direct and general way
> > of doing it, but there are some solutions…
>
> > I would suggest a new flag like % or $ for it.
> > I wonder if the syntax ${(%)str/X/Y} is going
> > to conflict with other functionalities of ZSH…
>
> But there is already a '%' flag...

This doesn't merits a new one.
>

What merits a new one then?


> Adding negative indexes support to the 'I' flag

> would be very good but verbose in my opinion.
>
> Extending the 'I' flag in this way would be ideal.
>

How do you extend the I flag?


--
https://about.me/dardo82

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

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: Substitute the last match of a pattern during parameters expansion.
  2022-09-13  4:19   ` Michele Venturi
@ 2022-09-13  6:06     ` Lawrence Velázquez
  2022-09-13 23:11       ` Bart Schaefer
  0 siblings, 1 reply; 24+ messages in thread
From: Lawrence Velázquez @ 2022-09-13  6:06 UTC (permalink / raw)
  To: Michele Venturi; +Cc: zsh-users

On Tue, Sep 13, 2022, at 12:19 AM, Michele Venturi wrote:
> On Mon, Sep 12, 2022, 08:01,
> Lawrence Velázquez,
> <larryv@zsh.org>, wrote:
>
>> But there is already a '%' flag...
>> This doesn't merits a new one.

No, I didn't write that.  What I wrote was: "There is already a '%'
flag.  I do not think this merits a new one."  I intentionally said
"I do not think" to make it clear that that was my personal opinion.

Please do not modify others' words and present the revision as a
quotation.  It's *extremely* poor form.

> What merits a new one then?

There isn't a strict policy or anything, but in my opinion new flags
should only be considered for broadly useful functionality that
cannot be implemented using the existing flags or enhanced versions
of them.  We already have an absurd number of flags; I don't think
new ones should be added willy-nilly.

Your use case could theoretically be satisfied by an enhanced 'I'
flag, so I don't think it deserves its own flag.

> How do you extend the I flag?

I don't know.  I am not familiar with the code base.

-- 
vq


^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: Substitute the last match of a pattern during parameters expansion.
  2022-09-13  6:06     ` Lawrence Velázquez
@ 2022-09-13 23:11       ` Bart Schaefer
  2022-09-14  3:20         ` Michele Venturi
  0 siblings, 1 reply; 24+ messages in thread
From: Bart Schaefer @ 2022-09-13 23:11 UTC (permalink / raw)
  To: zsh-users; +Cc: Michele Venturi

On Sun, Sep 11, 2022 at 11:01 PM Lawrence Velázquez <larryv@zsh.org> wrote:
>
>         % foo=aXbXcXdXe
>         % print ${(*)foo/(#b)(*)X/$match[1]Y}

That works for the last match, but not for the Nth-from-last.  (It
also works only in zsh 5.9+, before that you need extendedglob set.)

You can do it more generally like this:

N=0  # Number of X to skip over when counting from the right
print -- ${(*)foo/%(#b)(*)X(*(X*)(#c$N))/$match[1]Y$match[2]}

Nested parens with #b and #c are a bit iffy though, e.g., the values
of $match[3] and beyond here are not what you might expect.

On Mon, Sep 12, 2022 at 11:07 PM Lawrence Velázquez <larryv@zsh.org> wrote:
>
> Your use case could theoretically be satisfied by an enhanced 'I'
> flag, so I don't think it deserves its own flag.
>
> On Tue, Sep 13, 2022, at 12:19 AM, Michele Venturi wrote:
> > How do you extend the I flag?
>
> I don't know.  I am not familiar with the code base.

Unfortunately this is non-trivial, because the value of the parameter
is scanned+replaced left-to-right and we don't know how many matches
there will be, to count backward.

If you want to simulate a negative 'I' flag, one way is to use an
array, splitting and joining on the substring to replace:

N=-2
foo=aXbXcXdXe
z=(${(s:X:)foo})
print -- ${(j:X:)z[1,N-1]}Y${(j:X:)z[N,-1]}

Which you can write as a single substitution if you want to obfuscate it:

print -- ${${(A)z::=${(@s:X:)foo}}:+${(j:X:)z[1,N-1]}Y${(j:X:)z[N,-1]}}


^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: Substitute the last match of a pattern during parameters expansion.
  2022-09-13 23:11       ` Bart Schaefer
@ 2022-09-14  3:20         ` Michele Venturi
  2022-09-14 18:56           ` Bart Schaefer
  0 siblings, 1 reply; 24+ messages in thread
From: Michele Venturi @ 2022-09-14  3:20 UTC (permalink / raw)
  To: Bart Schaefer; +Cc: zsh-users

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

On Wed, Sep 14, 2022, 01:11 Bart Schaefer <schaefer@brasslantern.com> wrote:

> On Sun, Sep 11, 2022 at 11:01 PM Lawrence Velázquez <larryv@zsh.org>
> wrote:
> >
> >         % foo=aXbXcXdXe
> >         % print ${(*)foo/(#b)(*)X/$match[1]Y}
>
> That works for the last match, but not for the Nth-from-last.  (It
> also works only in zsh 5.9+, before that you need extendedglob set.)
>
> You can do it more generally like this:
>
> N=0  # Number of X to skip over when counting from the right
> print -- ${(*)foo/%(#b)(*)X(*(X*)(#c$N))/$match[1]Y$match[2]}
>
> Nested parens with #b and #c are a bit iffy though, e.g., the values
> of $match[3] and beyond here are not what you might expect.
>
> On Mon, Sep 12, 2022 at 11:07 PM Lawrence Velázquez <larryv@zsh.org>
> wrote:
> >
> > Your use case could theoretically be satisfied by an enhanced 'I'
> > flag, so I don't think it deserves its own flag.
> >
> > On Tue, Sep 13, 2022, at 12:19 AM, Michele Venturi wrote:
> > > How do you extend the I flag?
> >
> > I don't know.  I am not familiar with the code base.
>
> Unfortunately this is non-trivial, because the value of the parameter
> is scanned+replaced left-to-right and we don't know how many matches
> there will be, to count backward.
>
> If you want to simulate a negative 'I' flag, one way is to use an
> array, splitting and joining on the substring to replace:
>
> N=-2
> foo=aXbXcXdXe
> z=(${(s:X:)foo})
> print -- ${(j:X:)z[1,N-1]}Y${(j:X:)z[N,-1]}
>
> Which you can write as a single substitution if you want to obfuscate it:
>
> print -- ${${(A)z::=${(@s:X:)foo}}:+${(j:X:)z[1,N-1]}Y${(j:X:)z[N,-1]}}
>


Thanks for supporting my idea, even if unconsciously,
that explains why we need a dedicated flag very well...

Plus you seem quite good at non trivial tasks if you can
write that monstrousity... Do you know instead what IS trivial? Counting,
to know how many matches there are.

There are many examples of supporting negative index,
so I still don't see a reason why it is so difficult to do it...

>

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

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: Substitute the last match of a pattern during parameters expansion.
  2022-09-14  3:20         ` Michele Venturi
@ 2022-09-14 18:56           ` Bart Schaefer
  2022-09-14 20:06             ` Ray Andrews
  2022-09-14 21:59             ` Michele Venturi
  0 siblings, 2 replies; 24+ messages in thread
From: Bart Schaefer @ 2022-09-14 18:56 UTC (permalink / raw)
  To: Michele Venturi; +Cc: zsh-users

On Tue, Sep 13, 2022 at 8:20 PM Michele Venturi <dardo82@gmail.com> wrote:
>
> Plus you seem quite good at non trivial tasks if you can
> write that monstrousity... Do you know instead what IS trivial? Counting, to know how many matches there are.

Definitely keep using that approach, and see how much help it gets you
in future.

> There are many examples of supporting negative index,
> so I still don't see a reason why it is so difficult to do it...

For benefit of other readers ...

Forward indexing walks over the string once, replacing each occurrence
of a match as it finds it.

To implement negative indexing, it is necessary to walk once to the
end of the string to count the number of occurrences, while
"remembering" where each one appears, and then backtrack to the
position of the Nth-from-last match and replace just that one.

Those who think this is both easy and worthwhile to implement will
find the code in Src/glob.c in the function igetmatch().  Be sure to
trace the call chain all the way back to Src/subst.c to be sure you're
not violating any other constraints.


^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: Substitute the last match of a pattern during parameters expansion.
  2022-09-14 18:56           ` Bart Schaefer
@ 2022-09-14 20:06             ` Ray Andrews
  2022-09-14 21:59             ` Michele Venturi
  1 sibling, 0 replies; 24+ messages in thread
From: Ray Andrews @ 2022-09-14 20:06 UTC (permalink / raw)
  To: zsh-users

On 2022-09-14 11:56, Bart Schaefer wrote:
> On Tue, Sep 13, 2022 at 8:20 PM Michele Venturi <dardo82@gmail.com> wrote:
>> Plus you seem quite good at non trivial tasks if you can
>> write that monstrousity... Do you know instead what IS trivial? Counting, to know how many matches there are.
> Definitely keep using that approach, and see how much help it gets you
> in future.
Really.  I might bitch about some aspect of the shell but I'm not going 
to whine about the prompt, knowledgeable and unfailing help I get here, 
that's for sure.



^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: Substitute the last match of a pattern during parameters expansion.
  2022-09-14 18:56           ` Bart Schaefer
  2022-09-14 20:06             ` Ray Andrews
@ 2022-09-14 21:59             ` Michele Venturi
  2022-09-14 22:04               ` Bart Schaefer
  2022-09-15  0:29               ` Lawrence Velázquez
  1 sibling, 2 replies; 24+ messages in thread
From: Michele Venturi @ 2022-09-14 21:59 UTC (permalink / raw)
  To: Bart Schaefer; +Cc: zsh-users

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

On Wed, Sep 14, 2022, 20:56 Bart Schaefer <schaefer@brasslantern.com> wrote:

> On Tue, Sep 13, 2022 at 8:20 PM Michele Venturi <dardo82@gmail.com> wrote:
> >
> > Plus you seem good at non trivial tasks if you can
> > write that monstrousity.Do you know what's trivial? > Counting, to know
> how many matches there are...
>
> Definitely keep that approach and see

how much help it gets you in the future.
>

I'm the one helping you pointing out your weaknesses
and prodding you to get better,don't get confused,ok?

> There are examples of supporting negative index,
> > so don't see a reason why it is so difficult to do it.
>
> For benefit of other readers ...
>

So you are basically saying that I'm right but you don't
like me, so you don't want to talk to me, that is surely a
grown up approach, or maybe not? Not sure about it...

To implement negative indexing, it is necessary to walk to the end of the
> string to count the number of occurrences, while "remembering" where each
> one appears, and then backtrack to the position of the Nth-from-last match
> and replace just that one.
>
> Those who think this is both easy and worthwhile,


If you have written the code for the forward indexing,
it's easy and worthwhile,otherwise not so much,no?

Anyway it seems that nobody here is able to do it now,
so maybe this is the wrong place to ask for such things.

Are there other mailing list with more knowledgeable
people on this specific subject? Maybe ZSH-workers?

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

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: Substitute the last match of a pattern during parameters expansion.
  2022-09-14 21:59             ` Michele Venturi
@ 2022-09-14 22:04               ` Bart Schaefer
  2022-09-14 22:20                 ` Michele Venturi
  2022-09-15  0:29               ` Lawrence Velázquez
  1 sibling, 1 reply; 24+ messages in thread
From: Bart Schaefer @ 2022-09-14 22:04 UTC (permalink / raw)
  To: Michele Venturi; +Cc: zsh-users

On Wed, Sep 14, 2022 at 2:59 PM Michele Venturi <dardo82@gmail.com> wrote:
>
> So you are basically saying that I'm right but you don't
> like me

No, I'm saying you're wrong and I don't want to leave anyone else
confused about that.


^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: Substitute the last match of a pattern during parameters expansion.
  2022-09-14 22:04               ` Bart Schaefer
@ 2022-09-14 22:20                 ` Michele Venturi
  2022-09-15  0:00                   ` Alex Satrapa
  0 siblings, 1 reply; 24+ messages in thread
From: Michele Venturi @ 2022-09-14 22:20 UTC (permalink / raw)
  To: Bart Schaefer; +Cc: zsh-users

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

On Thu, Sep 15, 2022, 00:04 Bart Schaefer <schaefer@brasslantern.com> wrote:

> On Wed, Sep 14, 2022 at 2:59 PM Michele Venturi <dardo82@gmail.com> wrote:
> >
> > So you're saying that I'm right but you don't like me.


> No, I'm saying you're wrong and I don't want

to leave anyone else confused about that.
>

I don't care about your opinions and never did,
if you can't help don't waste my and others time.

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

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: Substitute the last match of a pattern during parameters expansion.
  2022-09-14 22:20                 ` Michele Venturi
@ 2022-09-15  0:00                   ` Alex Satrapa
  0 siblings, 0 replies; 24+ messages in thread
From: Alex Satrapa @ 2022-09-15  0:00 UTC (permalink / raw)
  To: Michele Venturi; +Cc: Bart Schaefer, zsh-users

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

This seems like a good place to end this thread.

> On 15 Sep 2022, at 08:20, Michele Venturi <dardo82@gmail.com> wrote:
> 
> On Thu, Sep 15, 2022, 00:04 Bart Schaefer <schaefer@brasslantern.com <mailto:schaefer@brasslantern.com>> wrote:
> On Wed, Sep 14, 2022 at 2:59 PM Michele Venturi <dardo82@gmail.com <mailto:dardo82@gmail.com>> wrote:
> >
> > So you're saying that I'm right but you don't like me.
> 
> No, I'm saying you're wrong and I don't want
> to leave anyone else confused about that.
> 
> I don't care about your opinions and never did,
> if you can't help don't waste my and others time.
> 
> 


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

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: Substitute the last match of a pattern during parameters expansion.
  2022-09-14 21:59             ` Michele Venturi
  2022-09-14 22:04               ` Bart Schaefer
@ 2022-09-15  0:29               ` Lawrence Velázquez
  2022-09-15  1:45                 ` Michele Venturi
  1 sibling, 1 reply; 24+ messages in thread
From: Lawrence Velázquez @ 2022-09-15  0:29 UTC (permalink / raw)
  To: Michele Venturi, Bart Schaefer; +Cc: zsh-users

On Wed, Sep 14, 2022, at 5:59 PM, Michele Venturi wrote:
> Anyway it seems that nobody here is able to do it now,
> so maybe this is the wrong place to ask for such things.

Don't conflate "can't do it" with "won't do it".

> Are there other mailing list with more knowledgeable
> people on this specific subject?

Bart has been involved with zsh for at least 27 years.  (I've only
downloaded the mailing list archives back to 1995.)  You probably
need just one hand to count the number of people in the world more
knowledgeable about zsh internals.  Two hands at most.

> Maybe ZSH-workers?

The zsh-workers list has already received this conversation, as all
messages to zsh-users are automatically cross-posted.

-- 
vq


^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: Substitute the last match of a pattern during parameters expansion.
  2022-09-15  0:29               ` Lawrence Velázquez
@ 2022-09-15  1:45                 ` Michele Venturi
  2022-09-15 12:01                   ` Roman Perepelitsa
  0 siblings, 1 reply; 24+ messages in thread
From: Michele Venturi @ 2022-09-15  1:45 UTC (permalink / raw)
  To: Lawrence Velázquez; +Cc: Bart Schaefer, zsh-users

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

On Thu, Sep 15, 2022, 02:29, Lawrence Velázquez, <larryv@zsh.org> wrote:

> On Wed, Sep 14, 2022, at 5:59 PM, Michele Venturi, <dardo82@gmail.com>
> wrote:
> > It seems that nobody here is able to do it now,
> > so this is the wrong place to ask for such things.
>
> Don't conflate "can't do it" with "won't do it".
>

If you can't do it (and you don't want to learn) you are useless, if you
don't want to do it (and it's a good idea)
you are guilty; anyway is it not MY problem. I will repeat
it because sadly you need it: I'm not here to ask for help,
but to help you improve YOUR project and how to do it...
So it seems like you are the one confused here, that is
refusing free suggestions and support for his activities.


> > Are there other mailing lists with more

> capable people on this specific subject?
>
> Bart has been involved with zsh for at least 27 years.  You need one hand
> to count the number of people in the world more knowledgeable about zsh
> internals.
>

These are probably too few people to work on it, right?

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

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: Substitute the last match of a pattern during parameters expansion.
  2022-09-15  1:45                 ` Michele Venturi
@ 2022-09-15 12:01                   ` Roman Perepelitsa
  2022-09-15 23:29                     ` Michele Venturi
  0 siblings, 1 reply; 24+ messages in thread
From: Roman Perepelitsa @ 2022-09-15 12:01 UTC (permalink / raw)
  To: Michele Venturi; +Cc: Lawrence Velázquez, Bart Schaefer, zsh-users

On Thu, Sep 15, 2022 at 3:46 AM Michele Venturi <dardo82@gmail.com> wrote:
>
> I'm not here to ask for help, but to help you improve YOUR project and how to do it...

If you put this in your original email, it would've saved everyone
time. Instead, you put the following:

> Hello, I have a problem, can you help me?

In projects that I own and maintain (zsh is not one of them) I expend
a lot of effort when people ask for help. I consider this time well
spent. These interactions allow me to see what users of my code are
trying to achieve, which in turn guides future development. Advice and
suggestions, on the other hand, have negative average value to me. I
usually ask users to not suggest solutions, for it often makes it
difficult for them to describe the actual problem at hand. Once I know
what the problem is, I'm in a much better position to suggest
solutions.

Coming back to the two quotes at the top, I would be annoyed if
somebody first asked me for help and then made a turnaround and
attempted to position themselves as a helper. If that person instead
made it clear from the start that they are trying to help, I would
point out that I'm not interested in help or advice but will try to do
my best if *they* need help. Less confusion and less time wasted on
both sides.

Take it with a grain of salt. I can easily imagine that other
maintainers see feedback differently from myself.

Roman.


^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: Substitute the last match of a pattern during parameters expansion.
  2022-09-15 12:01                   ` Roman Perepelitsa
@ 2022-09-15 23:29                     ` Michele Venturi
  2022-09-16  6:37                       ` Roman Perepelitsa
  0 siblings, 1 reply; 24+ messages in thread
From: Michele Venturi @ 2022-09-15 23:29 UTC (permalink / raw)
  To: Roman Perepelitsa; +Cc: Lawrence Velázquez, Bart Schaefer, zsh-users

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

On Thu, Sep 15, 2022, 14:02 Roman Perepelitsa <roman.perepelitsa@gmail.com>
wrote:

Once I know what the problem is, I'm in a much better

position to suggest solutions.
>

So what is your suggested solution?

Take it with a grain of salt. I can imagine that other maintainers see
> feedback differently from myself.
>

When you collaborate you ask for help and offer help...

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

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: Substitute the last match of a pattern during parameters expansion.
  2022-09-15 23:29                     ` Michele Venturi
@ 2022-09-16  6:37                       ` Roman Perepelitsa
  2022-09-16  7:52                         ` Michele Venturi
  0 siblings, 1 reply; 24+ messages in thread
From: Roman Perepelitsa @ 2022-09-16  6:37 UTC (permalink / raw)
  To: Michele Venturi; +Cc: Lawrence Velázquez, Bart Schaefer, zsh-users

On Fri, Sep 16, 2022 at 1:29 AM Michele Venturi <dardo82@gmail.com> wrote:
>
> On Thu, Sep 15, 2022, 14:02 Roman Perepelitsa <roman.perepelitsa@gmail.com> wrote:
>
>> Once I know what the problem is, I'm in a much better
>> position to suggest solutions.
>
>
> So what is your suggested solution?

Depends on the problem.

In this particular case I wasn't a part of the conversation where help
was requested, offered and refused. My comment was not on the subject
matter but on the conversation itself.

>> Take it with a grain of salt. I can imagine that other maintainers see feedback differently from myself.
>
> When you collaborate you ask for help and offer help...

Let's not discuss definitions of words on which nothing hinges and
which haven't been mentioned before.

Roman.


^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: Substitute the last match of a pattern during parameters expansion.
  2022-09-16  6:37                       ` Roman Perepelitsa
@ 2022-09-16  7:52                         ` Michele Venturi
  2022-09-16  7:57                           ` Roman Perepelitsa
  0 siblings, 1 reply; 24+ messages in thread
From: Michele Venturi @ 2022-09-16  7:52 UTC (permalink / raw)
  To: Roman Perepelitsa; +Cc: Lawrence Velázquez, Bart Schaefer, zsh-users

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

On Fri, Sep 16, 2022, 08:37 Roman Perepelitsa <roman.perepelitsa@gmail.com>
wrote:

On Fri, Sep 16, 2022 at 1:29 AM Michele Venturi <dardo82@gmail.com> wrote:
> >
> > So what is your suggested solution?
>
> Depends on the problem.
>

The problem is extending the (I) flag of parameters
expansion in ZSH to the negative numbers as I said.

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

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: Substitute the last match of a pattern during parameters expansion.
  2022-09-16  7:52                         ` Michele Venturi
@ 2022-09-16  7:57                           ` Roman Perepelitsa
  2022-09-16  8:19                             ` Michele Venturi
  0 siblings, 1 reply; 24+ messages in thread
From: Roman Perepelitsa @ 2022-09-16  7:57 UTC (permalink / raw)
  To: Michele Venturi; +Cc: Lawrence Velázquez, Bart Schaefer, zsh-users

On Fri, Sep 16, 2022 at 9:52 AM Michele Venturi <dardo82@gmail.com> wrote:
>
> On Fri, Sep 16, 2022, 08:37 Roman Perepelitsa <roman.perepelitsa@gmail.com> wrote:
>
>> On Fri, Sep 16, 2022 at 1:29 AM Michele Venturi <dardo82@gmail.com> wrote:
>> >
>> > So what is your suggested solution?
>>
>> Depends on the problem.
>
>
> The problem is extending the (I) flag of parameters
> expansion in ZSH to the negative numbers as I said.

That's the problem (or rather a suggested solution) on the subject
matter. I was commenting on the problem on the meta level. In any
case, I think we've exhausted this topic.

Roman.


^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: Substitute the last match of a pattern during parameters expansion.
  2022-09-16  7:57                           ` Roman Perepelitsa
@ 2022-09-16  8:19                             ` Michele Venturi
  2022-09-16  8:22                               ` Roman Perepelitsa
  0 siblings, 1 reply; 24+ messages in thread
From: Michele Venturi @ 2022-09-16  8:19 UTC (permalink / raw)
  To: Roman Perepelitsa; +Cc: Lawrence Velázquez, Bart Schaefer, zsh-users

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

On Fri, Sep 16, 2022, 09:57 Roman Perepelitsa <roman.perepelitsa@gmail.com>
wrote:

In any case, I think we've exhausted this topic.
>

So can we stop arguing and start working please?

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

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: Substitute the last match of a pattern during parameters expansion.
  2022-09-16  8:19                             ` Michele Venturi
@ 2022-09-16  8:22                               ` Roman Perepelitsa
  2022-09-16  8:33                                 ` Michele Venturi
  0 siblings, 1 reply; 24+ messages in thread
From: Roman Perepelitsa @ 2022-09-16  8:22 UTC (permalink / raw)
  To: Michele Venturi; +Cc: Lawrence Velázquez, Bart Schaefer, zsh-users

On Fri, Sep 16, 2022 at 10:20 AM Michele Venturi <dardo82@gmail.com> wrote:
>
> On Fri, Sep 16, 2022, 09:57 Roman Perepelitsa <roman.perepelitsa@gmail.com> wrote:
>
>> In any case, I think we've exhausted this topic.
>
>
> So can we stop arguing and start working please?

Just to be clear, I don't intend to make any changes to zsh that are
being discussed here. It is my understanding that neither does anyone
else.

Roman.


^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: Substitute the last match of a pattern during parameters expansion.
  2022-09-16  8:22                               ` Roman Perepelitsa
@ 2022-09-16  8:33                                 ` Michele Venturi
  2022-09-16  8:36                                   ` Roman Perepelitsa
  0 siblings, 1 reply; 24+ messages in thread
From: Michele Venturi @ 2022-09-16  8:33 UTC (permalink / raw)
  To: Roman Perepelitsa; +Cc: Lawrence Velázquez, Bart Schaefer, zsh-users

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

On Fri, Sep 16, 2022, 10:22 Roman Perepelitsa <roman.perepelitsa@gmail.com>
wrote:

On Fri, Sep 16, 2022 at 10:20 AM Michele Venturi <dardo82@gmail.com> wrote:
> >
> > On Fri, Sep 16, 2022, 09:57 Roman Perepelitsa <
> roman.perepelitsa@gmail.com> wrote:
> >
> >> In any case, I think we've exhausted this topic.
> >
> > So can we stop arguing and start working please?
>
> I don't intend to make any changes to zsh that are being discussed here
> and neither does anyone else.
>

I do.

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

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: Substitute the last match of a pattern during parameters expansion.
  2022-09-16  8:33                                 ` Michele Venturi
@ 2022-09-16  8:36                                   ` Roman Perepelitsa
  2022-09-16  9:08                                     ` Michele Venturi
  0 siblings, 1 reply; 24+ messages in thread
From: Roman Perepelitsa @ 2022-09-16  8:36 UTC (permalink / raw)
  To: Michele Venturi; +Cc: Lawrence Velázquez, Bart Schaefer, zsh-users

On Fri, Sep 16, 2022 at 10:33 AM Michele Venturi <dardo82@gmail.com> wrote:
>
> On Fri, Sep 16, 2022, 10:22 Roman Perepelitsa <roman.perepelitsa@gmail.com> wrote:
>
>> On Fri, Sep 16, 2022 at 10:20 AM Michele Venturi <dardo82@gmail.com> wrote:
>> >
>> > On Fri, Sep 16, 2022, 09:57 Roman Perepelitsa <roman.perepelitsa@gmail.com> wrote:
>> >
>> >> In any case, I think we've exhausted this topic.
>> >
>> > So can we stop arguing and start working please?
>>
>> I don't intend to make any changes to zsh that are being discussed here and neither does anyone else.
>
> I do.

OK. If you absolutely must edit my quotes, please indicate so clearly.

Roman.


^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: Substitute the last match of a pattern during parameters expansion.
  2022-09-16  8:36                                   ` Roman Perepelitsa
@ 2022-09-16  9:08                                     ` Michele Venturi
  0 siblings, 0 replies; 24+ messages in thread
From: Michele Venturi @ 2022-09-16  9:08 UTC (permalink / raw)
  To: Roman Perepelitsa; +Cc: Lawrence Velázquez, Bart Schaefer, zsh-users

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

On Fri, Sep 16, 2022, 10:36 Roman Perepelitsa <roman.perepelitsa@gmail.com>
wrote:

If you absolutely must edit my quotes,

please indicate so clearly.
>

I've edited your quote, are you happy now?

>

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

^ permalink raw reply	[flat|nested] 24+ messages in thread

end of thread, other threads:[~2022-09-16  9:09 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-12  4:20 Substitute the last match of a pattern during parameters expansion Michele Venturi
2022-09-12  6:01 ` Lawrence Velázquez
2022-09-13  4:19   ` Michele Venturi
2022-09-13  6:06     ` Lawrence Velázquez
2022-09-13 23:11       ` Bart Schaefer
2022-09-14  3:20         ` Michele Venturi
2022-09-14 18:56           ` Bart Schaefer
2022-09-14 20:06             ` Ray Andrews
2022-09-14 21:59             ` Michele Venturi
2022-09-14 22:04               ` Bart Schaefer
2022-09-14 22:20                 ` Michele Venturi
2022-09-15  0:00                   ` Alex Satrapa
2022-09-15  0:29               ` Lawrence Velázquez
2022-09-15  1:45                 ` Michele Venturi
2022-09-15 12:01                   ` Roman Perepelitsa
2022-09-15 23:29                     ` Michele Venturi
2022-09-16  6:37                       ` Roman Perepelitsa
2022-09-16  7:52                         ` Michele Venturi
2022-09-16  7:57                           ` Roman Perepelitsa
2022-09-16  8:19                             ` Michele Venturi
2022-09-16  8:22                               ` Roman Perepelitsa
2022-09-16  8:33                                 ` Michele Venturi
2022-09-16  8:36                                   ` Roman Perepelitsa
2022-09-16  9:08                                     ` Michele Venturi

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).