I'd like to use find to report files under the following conditions:
- If the file contains the word "Serializable"
- Then report the file if it does NOT contain the word "serialVersionUID"
Something like:
find . -name "*.java" -exec grep "Serializable" {} \; <magic stuff here> grep "serialVersionUID" {} \; -print
So am I smoking crack and would be better served by awk?
Thanks for your help.
-a
is optional. – jw013 Oct 23 '14 at 20:36find . -name "*.java" -exec grep -E -q '(implements [a-zA-Z0-9]*[ ]*|[,]+[ ]+)Serializable' {} \; -a ! -exec grep -q "serialVersionUID" {} \; -a -print
– D-Klotz Oct 23 '14 at 21:15