Re: Parameter Expansion

Vin Shelton <[email protected]>
Newsgroups gmane.comp.shells.zsh.devel,gmane.comp.shells.zsh.user
Message-ID <CACeGjnULdr+zyC=rmp8JbV-ouPgfJMGKSfQk1nYS=OrJ+xPQPA@mail.gmail.com>
Although I see history mentioned in the zshexpn manpage, I don't know what
my example has to do with history.

On Tue, Jul 15, 2025 at 11:01 AM Eric Cook <[email protected]> wrote:

> On 7/15/25 10:44 AM, Vin Shelton wrote:
> > I don't understand the order of parameter expansion. Consider the
> following example:
> >
> > zsh -f
> > export HOME=/home/acs
> > smaug% export SCMROOT=/home/acs/scmroot
> > smaug% echo ${SCMROOT:s-$HOME/--}
> >
> > This yields /home/acs/scmroot", but I expected "scmroot".
> > TIA,
> >   Vin Shelton
> >
>
> The history modifier doesn't create a new context where the parameter
> expansion code recurses and resolves any parameters within it's operands.
> It is searching for the literal string $HOME.
>
>

-- 
Whoa, I'm just surprised at how accurate that description of me really is:
some old cowboy guy that used to shoot movies at Spahn Ranch
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.