I'm trying to show to the user the list of zip file contained in a folder and give user the ability to choice which file to elaborate.
i'm trying this
roms=$(ls ~/roms/*.zip)
PS3="Choose a ROM "
select opt in "${roms[@]}" "quit"; do
....
done
The problem is that my menu is showed in this way:
1) /home/realtebo/roms/rom_01.zip
/home/realtebo/roms/rom_02.zip
/home/realtebo/roms/rom_02_v2.zip
....
2) quit
Instead I need this
1) /home/realtebo/roms/rom_01.zip
2) /home/realtebo/roms/rom_02.zip
3) /home/realtebo/roms/rom_02_v2.zip
...
n+1) quit
How to 'explode' the result of ls as an array? I'm using bash under linux mint 17.3