[GLLUG] find / shell weirdness

tid td at bloogaloo.co.uk
Tue Oct 8 09:30:31 UTC 2013


I have a small bash script which watches a number of folders for files
added in the last 10 minutes:

($mydirs below is just a list of ftp folders which clients upload to )

find $mydirs -type f -a -cmin -10 -print > /tmp/filewatcher.count

if [ `wc -l /tmp/filewatcher.count | awk ' { print $1 } ' ` -gt 0 ]
        # email me notification bla bla bla
        [ snip ]

So, this has been working fine but recently it's started giving me a
lot of false positives - i.e the 'if' statement is firing, but no files are
found - is there
some shell expansion going of which I'm unaware, or is it the more likely

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.lug.org.uk/pipermail/gllug/attachments/20131008/ce3f8ce5/attachment.html>

More information about the GLLUG mailing list