1: 2: 3: 4: 5: 6: 7: 8: 9: 10:
awk ' /^class/ && $2 !~ /^[A-Z]/{ print $0 ,"//ERR: class name should start with Upper case***" next } /^ +(int|double|boolean|float|String)/ && $2 !~ /^[A-Z]/{ print $0,"//ERR: varible name should start with Upper case***" next } 1 ' file