This works in shell:
grep -R --exclude-dir=storage --exclude-dir=node-modules --include=*.{scss,css} loader.gif
But this fails:
sh -c "grep -R --exclude-dir=storage --exclude-dir=node-modules --include=*.{scss,css} loader.gif"
It fails without any message, it just can't find any occurrence.
This works:
sh -c "grep -R --exclude-dir=storage --exclude-dir=node-modules --include=*.scss loader.gif"
Why the use of curly braces in --include=*.{scss,css}
fails?
sh
has no brace-expansion, use for examplebash
orzsh
orcsh
. see also Why is brace expansion not supported? – αғsнιη Feb 11 '20 at 17:48--include=*.{s,}css
– Paulo Tomé Feb 11 '20 at 17:50find
to find files andgrep
to g/re/p within files. There are clues in the tools names to their intended use! – Ed Morton Feb 17 '20 at 20:43