Sample Header Ad - 728x90

How to get zip to treat any missing file as an error?

11 votes
1 answer
632 views
To reproduce:
❯ cd "$(mktemp --directory)"
❯ zip result.zip foo no-such-file
	zip warning: name not matched: no-such-file
  adding: foo (stored 0%)
❯ echo $?
0
zip should return a non-zero exit code when *any* of the files are missing, but it only does so if *all* the files are missing. How do I change this behaviour?
Asked by l0b0 (53368 rep)
May 1, 2025, 12:14 PM
Last activity: May 1, 2025, 12:20 PM