Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

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

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.



Messages sorted by: Reverse Date, Date, Thread, Author