We want to check where our programmers are using lowercase SQL reserved words, ie "select" instead of "SELECT".
Obviously, we should not raise a warning for code which is commented out with "//".
Suppose I have this input:
select * from mytable
SELECT * from mytable
// select * from mytable statement, but as a comment
select * from mytable statement outside the comment //
So the following code does not work, because it does not return the last line:
grep select myfile.cpp | grep -v "//"
How do I change the expression so that lines with lowercase "select" are returned and which are not preceded by "//"?