zsh-workers
 help / color / mirror / code / Atom feed
From: "S. Cowles" <scowles@ckhb.org>
To: zsh-workers@zsh.org
Subject: parameter expansion, substitution
Date: Fri, 9 Mar 2012 14:03:29 -0800 (PST)	[thread overview]
Message-ID: <alpine.LN8.2.00.1203091332580.1456@ckhb06.ckhb.org> (raw)

i am not getting expected results in the following code snippet:
 	b="abc" ; b=${b/#abc%/d} ; echo ${b}
i expect the value of b to be changed to "d"; however, it remains "abc".

the following snippet does give the expected result:
 	b="abc" ; b=${b/#abc/d} ; echo ${b}

for this session, the following shell options are set: interactive monitor 
shinstdin zle.  the version of the shell being used is 4.3.17-dev-0, 
patchlevel 1.5604.

in my use case, i need to specify a pattern match at the end of the 
parameter.  have i misunderstood the syntax of the '%' end-of-string 
operator?  or is this problem something else?

thanks for any help.


             reply	other threads:[~2012-03-09 22:20 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-09 22:03 S. Cowles [this message]
2012-03-09 22:25 ` Mikael Magnusson
2012-03-09 22:48   ` S. Cowles
2012-03-09 22:27 ` Bart Schaefer

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=alpine.LN8.2.00.1203091332580.1456@ckhb06.ckhb.org \
    --to=scowles@ckhb.org \
    --cc=zsh-workers@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).