0

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.

2
  • Not sure what's wrong, but there's a way to debug this. If you replace grep with echo grep in all places, it will only print the according call after (!) the different shell substitutions, showing you the exact invocations. Commented Dec 28, 2023 at 19:25
  • The grep I know how to use will accept the -i option to ignore case. Good luck. Commented Dec 29, 2023 at 15:47

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.