Re: ${//}: say how to non-destructively prefix/suffix
From:
Stephane Chazelas
Subject:
Re: ${//}: say how to non-destructively prefix/suffix
Date:
Sun, 5 Nov 2006 22:09:08 +0000
User-agent:
Mutt/1.5.6i
On Mon, Nov 06, 2006 at 02:54:25AM +0800, Dan Jacobson wrote:
> Regarding the
> ${parameter/pattern/string}
> ${parameter//pattern/string}
> discussion on the man page:
> You don't mention what if pattern is null.
> Seems that will never match.
> Anyway, no way to
> $ set aa bb cc
> $ echo ${@....}
> so that one gets all parameters to have a string appended,
> e.g. aa.t bb.t cc.t
> One must sacrifice at least one character in "pattern". No way to
> destroy less than one character.
[...]
echo "${@/%/.t}"
--
Stéphane