Skip to content
Advertisement

grep -r –include not works but –exclude works

In bash,

JavaScript

What’s the problem?

Advertisement

Answer

You are using curly braces incorrectly. The correct syntax would look like

JavaScript

(Notice also the addition of the missing file name argument . at the end.)

You can see what’s going wrong by putting an echo in front and examining what the shell expands the braces to.

JavaScript
User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement