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

Re: Append string to every element in a list?



On 28/02/2008, Richard Hartmann <richih.mailinglist@xxxxxxxxx> wrote:
> Hi all,
>
>  I have a program that returns
>
>   a b c d e [...]
>
>  and would need to append foo to every single element. Maybe
>  it's the time of day, but I can't figure out how to do this atm,
>  even though it should be trivial..

Maybe something like this

% a=($(echo a b c))
% print -l $a
a
b
c
% print -l ${^a}foo
afoo
bfoo
cfoo

-- 
Mikael Magnusson



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