0
1
I have a bunch of zipped up log files and I want to search them all for a string. I tried this but it's not working:
find ./ -name "*.log.zip" -exec gzip -dc {} | grep ERROR \;
It's giving me:
find: incomplete statement
grep: can't open ;
What I want is, for each .log.zip file, unzip it and grep the output for "ERROR". Doing this on AIX, for what it's worth.
btw, I've managed to get the result I wanted by putting the -exec commands in a separate script and then using -exec script {} ; But I'd still like to know why the above doesn't work and if it's possible to do what I want without creating an intermediate script. – mluisbrown – 2013-04-08T10:45:28.207