growbag
#1
I’m trying to get a list of .bsp files from a long list of .pk3 (.zip) files.
I can do that with one single file as in this example -
zipinfo filename.pk3 | grep .bsp
But sadly zipinfo doesn’t like using the wildcard for in_file_name.
I need to be able to do something like this in a bash script -
for each <filename.pk3>
do
zipinfo <filename> | grep .bsp >> maps.txt
end
I have no idea how to do that though, any help appreciated 
ken_yap
#2
for f in *.pk3
do
zipinfo $f | grep '\.bsp'
done > maps.txt
growbag
#3
Fantastic, thanks a million 
ken_yap
#4
Actually even I forget this sometimes but you should write:
zipinfo “$f” …
just in case the filename contains whitespace.
ken_yap
#5
Actually even I forget this sometimes but you should write:
zipinfo “$f” …
just in case the filename contains whitespace.
Use the find command. For example:
find . -name "*.pk3" -exec zipinfo -1 {} \;
NOTE: The space before the backslash semicolon is required.