zsh-workers
 help / color / mirror / code / Atom feed
From: "Heading, Anthony" <heading_anthony@jpmorgan.com>
To: "Zoltan Hidvegi" <hzoli@cs.elte.hu>
Cc: zsh-workers@math.gatech.edu
Subject: RE: hzoli change:  $foo:s//r/
Date: 15 Aug 1995 18:36:43 U	[thread overview]
Message-ID: <n1403628615.31686@smtpgwprod.ny.jpmorgan.com> (raw)

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


             reply	other threads:[~1995-08-15 17:38 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1995-08-15 18:36 Heading, Anthony [this message]
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

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=n1403628615.31686@smtpgwprod.ny.jpmorgan.com \
    --to=heading_anthony@jpmorgan.com \
    --cc=hzoli@cs.elte.hu \
    --cc=zsh-workers@math.gatech.edu \
    /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).