zsh-workers
 help / color / mirror / code / Atom feed
* RE: hzoli change:  $foo:s//r/
@ 1995-08-15 18:36 Heading, Anthony
  1995-08-15 17:52 ` Zoltan Hidvegi
  0 siblings, 1 reply; 12+ messages in thread
From: Heading, Anthony @ 1995-08-15 18:36 UTC (permalink / raw)
  To: Zoltan Hidvegi; +Cc: zsh-workers

Umm, I remember patching this a couple of years ago to give its recent
behaviour. It used to loop infinitely I think. The change never made it into
the manual, so I agree it's undocumented and it's quite reasonable to
change it.   But it did work, I don't consider it a bug, quite a number
of my scripts turned out to use it [they all fell over today :-( ] and I'm
a bit upset at seeing it go just to introduce an unnecessary error message.

Can't we just document it?

A
_______________________________________________________________________________
From: Zoltan Hidvegi on Tue, Aug 15, 1995 1:05 pm
Subject: Re: hzoli change:  $foo:s//r/
To: Heading Anthony
Cc: zsh-workers

Anthony Heading wrote:
> 
> Sorry I missed this first time round.
> 
> hzoli changelog of Jul 10 says:
> - $foo:s//r/ gives ... error message ... (194)
> 
> Now the following used to work
> 
> % array=(a b c d e)
> % echo $array:s//\&-\&/
> a-a b-b c-c d-d e-e
> 
> I remember I had a use for this once...

The problem is that the manual says that zsh should use the left-hand-side of
the last substitution if the substitution string is empty.  And the history
code also does this.  Also the code in hist.c which produced that feature you
describe was buggy and it sometimes got into an infinite loop (or did some
even worse thing).  So what you used so far was probably an undocumented bug.
Maybe we can find an other syntax for that.

Zoltan


^ permalink raw reply	[flat|nested] 12+ messages in thread
* hzoli change:  $foo:s//r/
@ 1995-08-15 12:49 Heading, Anthony
  1995-08-15 17:02 ` Zoltan Hidvegi
  0 siblings, 1 reply; 12+ messages in thread
From: Heading, Anthony @ 1995-08-15 12:49 UTC (permalink / raw)
  To: zsh-workers

Sorry I missed this first time round.

hzoli changelog of Jul 10 says:
- $foo:s//r/ gives ... error message ... (194)

Now the following used to work

% array=(a b c d e)
% echo $array:s//\&-\&/
a-a b-b c-c d-d e-e

I remember I had a use for this once...

Anthony


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

end of thread, other threads:[~1995-08-16 22:29 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1995-08-15 18:36 hzoli change: $foo:s//r/ Heading, Anthony
1995-08-15 17:52 ` Zoltan Hidvegi
  -- strict thread matches above, loose matches on Subject: below --
1995-08-15 12:49 Heading, Anthony
1995-08-15 17:02 ` Zoltan Hidvegi
1995-08-16  1:48   ` Thorsten Meinecke
1995-08-16 11:59     ` Zoltan Hidvegi
1995-08-16 14:49       ` Thorsten Meinecke
1995-08-16 15:20         ` Zoltan Hidvegi
1995-08-16 16:01           ` Barton E. Schaefer
1995-08-16 18:18           ` Wayne Davison
1995-08-16 18:24             ` Zoltan Hidvegi
1995-08-16 22:22               ` Zefram

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