Friday, May 3, 2024
11
rated 0 times [  11] [ 0]  / answers: 1 / hits: 15717  / 2 Years ago, thu, may 5, 2022, 2:46:52

The Background: I have a python script that generates a bunch of images (png format, minimum of several hundred), runs ffmpeg to turn them into a short video, and then puts all of the images into a zip archive so I can go back if I find any strange or interesting things where I want the individual frame.



The Issue: Originally the zip portion read as zip -q -T -m output *.png but that suppressed all the output, including the statement as to whether the file is ok. Is there a way to suppress the large number of updating: Stars0053.png (deflated 5%) without suppressing the output of the -T switch?


More From » command-line

 Answers
4
zip -q -T -m output *.png  && echo "success" || echo "failure"


should work too, alternative to the solution, given in the comments.



It works like this: If the first commmand (zip ...) succeeds, the following combination with && can succeed too and is performed. But if the first part fails, then the whole combination will fail, and the &&-part is skipped, but an or-combination is successfull if one of both is successful, so the ||-part is performed.



You aren't interested in the combined result (true/false), but in the side-effect: a status feedback.


[#44580] Friday, May 6, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
bewre

Total Points: 164
Total Questions: 108
Total Answers: 106

Location: Ghana
Member since Sun, Mar 27, 2022
2 Years ago
bewre questions
Sun, May 14, 23, 13:27, 1 Year ago
Mon, Aug 2, 21, 03:57, 3 Years ago
Thu, Aug 26, 21, 18:05, 3 Years ago
Sat, Aug 6, 22, 21:41, 2 Years ago
Sat, Jul 24, 21, 22:52, 3 Years ago
;