Is there anyway to check the number of file in a directory, if the number of files is correct, say 5 files, zip the files with zip -r total.zip. If the number of files is wrong, wait 3 seconds, and check the number of files again. Keep repeating until either correct, and exit or timeout.
Is there anyway to do the case above, I have huge files that is in several part in a folder, and I want to zip it only after the file finish merging using cat command. the individual part will be remove as it is finish merging.