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

Re: How to add string to end of each array element without loops



> On 25 March 2011 22:32,  <nix@xxxxxxxxxxxxxxxx> wrote:
>> a=(1 2 3)
>> a=(foo$^a[@])
>>
>> print -l "${(@n)a}"
>>
>> foo1
>> foo2
>> foo3
>>
>> I would like to get the following output instead:
>>
>> 1foo
>> 2foo
>> 3foo
>
> a=(${^a}foo) ?
>
> --
> Mikael Magnusson
>

Worked, thank you. For some reason subscripts are giving to me headaches.
Maybe I should ghet more fresh air to clear my head out :)





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