Stuart
11-03-10, 12:00 PM
I have a script that does stuff to files, but if the files are smaller than 200bytes the script/tool goes bonkers and writes output files till the drive is full.
I want to put in some detection for files smaller than 200bytes (although I believe its only possible to detect less than 512bytes)
I've tried DU -sk name which returns how many 512byte blocks the file occupies, which is fine but I cant seem to get the number of blocks to go into a variable to compare in an if statement..
helps from the g33ks please lol
I want to put in some detection for files smaller than 200bytes (although I believe its only possible to detect less than 512bytes)
I've tried DU -sk name which returns how many 512byte blocks the file occupies, which is fine but I cant seem to get the number of blocks to go into a variable to compare in an if statement..
helps from the g33ks please lol