This is my final script
find -regex "^\..*[^(~$|\.o$|\.exe)]" | grep -v "\.svn" | grep -v ".tab." | grep -v ".yy." | xargs svn add 2>/dev/null
For testing i dont want to add it to svn so i use
find -regex "^\..*[^(~$|\.o$|\.exe)]" | grep -v "\.svn" | grep -v ".tab." | grep -v ".yy."
NOTE: I wanted to ignore files that started with '.' (in current and subfolders) but couldnt figure out how so i settled for .svn
I tried removing the extra greps to produce one regex but for the life of me i couldnt get it to ignore .svn (or .FILE) in current and sub folders and i couldnt get it to ignore .tab. or .yy.
One problem is i couldnt understand how to make ^. (ignore if start with?) work. I'm sure one problem is the fact i do .* which will ignore my .tab. rule and i am not sure how to get around.