Hi, I am fairly new to programming and I need some help with my script.
I want to list the contents of a zip file amd put each entry into an array.
I've been doing
Code:
array=($(unzip*-qq*-l*"/path/to/file.zip"*|*awk*'{print*$4}'))
which works alright, and when I do
Code:
for str in ${array[@]}; do
echo "$str"
done
It gives
Code:
asdf/something
base/asdf/something/the_quick_brown_fox_jumped_over_the_lazy_dog
.. until an item has a space in it's name
Code:
for str in ${array[@]}; do
echo "$str"
done
Gives
Code:
asdf/something
base/asdf/something/the
quick
brown
fox
jumped
over
the
lazy
dog
Thanks