You need to protect your wildcard pattern with single quotes, otherwise the shell will expand it (this is called globbing):
for file in *.zip; do
unzip ${file} '*.txt'
done
During the first iteration of the loop, *.txt
doesn't expand to anything as there are no txt files in the working directory, so the command works as expected. After the first iteration, it expands to all the txt files you just extracted from the first zip file, so the second and subsequent iterations actually look something like this after globbing:
unzip ${file} file1.txt