From: Bart Schaefer <schaefer@brasslantern.com>
To: zsh-workers@zsh.org
Subject: Re: parameter expansion, substitution
Date: Fri, 09 Mar 2012 14:27:04 -0800 [thread overview]
Message-ID: <120309142704.ZM16563@torch.brasslantern.com> (raw)
In-Reply-To: <alpine.LN8.2.00.1203091332580.1456@ckhb06.ckhb.org>
On Mar 9, 2:03pm, S. Cowles wrote:
} Subject: parameter expansion, substitution
}
} 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".
You've misunderstood. You want:
b="abc" ; b=${b/#%abc/d} ; echo ${b}
The # or % or #% must appear at the beginning of the pattern, they are
not positional like ^ and $ in a regular expression.
prev parent reply other threads:[~2012-03-09 22:27 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-03-09 22:03 S. Cowles
2012-03-09 22:25 ` Mikael Magnusson
2012-03-09 22:48 ` S. Cowles
2012-03-09 22:27 ` Bart Schaefer [this message]
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=120309142704.ZM16563@torch.brasslantern.com \
--to=schaefer@brasslantern.com \
--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).