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

Re: parameter expansion, substitution



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.



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