Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

add string at beginning of each array entry

For example, I have a=(1 2 3) and I want to get a=(foo1 foo2 foo3). What would be an easy/clean way to get that?

like image 985
Albert Avatar asked Apr 21 '26 00:04

Albert


1 Answers

a=(foo$^a[@])

like image 158
Gilles 'SO- stop being evil' Avatar answered May 06 '26 00:05

Gilles 'SO- stop being evil'