i know how to add a file to the root folder within a zip file:
zip -g xxx.apk yyy.txt
but i\'ve no idea how to specify a particu
To elaborate on @Ignacio Vazquez-Abrams answer from a year ago, you can use a lower level library, such as the one that comes with Python:
#!/bin/bash
python -c '
import zipfile as zf, sys
z=zf.ZipFile(sys.argv[1], "a")
z.write(sys.argv[2], sys.argv[3])
z.close()
' myfile.zip source/dir/file.txt dir/in/zip/file.txt
This will open myfile.zip
and add source/dir/file.txt
from the file system as dir/in/zip/file.txt
in the zip file.