Ignore case in grep alias

33 views Asked by At

I'm having an alias to look for lines that set value of variables in Tcl like this:

alias vgrep 'grep -rn "set\s\+\!:1\s\+"'

Let's say I have a test.tcl file like:

set result 0
set RESULT 1
...

When I use vgrep result test.tcl -i (--ignore-case), it just prints the first line of the file, which I supposed it to print both lines.

But when use grep -rn "set\s\+result\s\+" test.tcl -i, it prints both lines.

So, what's the problem here. Any idea would help. Thanks.

0

There are 0 answers