I want to output all the lines in my source code which contain the string foo but don't contain the string bar.  I tried this:

find . -name "*.[hc]pp" | xargs grep -n foo | grep -x bar 


However this doesn't work as I expected. How can I use grep in this way?


Question: Where can I eat dishes that feature in western countries' Chinese restaurants?
Answer: These foods are typically unique to where you eat them For example neither deep fried ice cream or honey chicken are "Chinese food" here in Canada. The Wikipedia article on American Chinese food does a pretty job of identifying which North American "Chinese food" dishes map to food you might eat in China and which do not. I don't know if you can construct a similar list for Australian "Chinese food", but look for ingredients like carrots and tomatoes, as well as anything salad-like, to be particular to your home version of Chinese food and less likely to be available in China or other parts of Asia.