I need to run a loop with a command but as it loops through the command I need it to sleep for a bit if there is more than 3 trans logs in the db directory, not sure how to put in the sleep in this case.
for example, if I use a for loop such as this
for i in `cat file-input.txt`;do ./command $i;done
I need to do a --- echo `ls /data/csdb/log* | wc -l`
and only continue if the count is 3 or less,
so I need to put in a if statement but not sure how here.
Thanks,
Start Free Trial