Shell commands or script to unzip, add text file and rezip

Solution 1:

You don't even need to unzip the files, you can update an existing file:

zip -u existing.zip file.txt

from zip manual:

update (-u)
    Update existing entries if newer on the file system and add new files. 
    If the archive does not exist issue warning then create a new archive.

If you want to add a complete folder, add -r.


To update a number of zip files, do something like this:

for z in *.zip; do
    zip -u "$z" file.txt
done

See this related question on U&L.