News for hackers. Stuff that matters.
Re:CLI tools hidden in the Python standard library by dfc on Thursday June 29, 2023 @08:04AM (#36519308)
I am not someone who complains about "stop piping cats" but using '-e' with grep is a lot quicker and easier to read. This:

    grep -v 'test/' | grep -v 'tests/' | grep -v idlelib | grep -v turtledemo
Becomes:

    grep -ve 'test/' -e 'tests/' -e idlelib -e turtledemo
Re:CLI tools hidden in the Python standard library by yunohn on Thursday June 29, 2023 @11:42AM (#36521968)
To be fair, the advantage of doing separate greps is working iteratively and drilling down on what you want.
Re:CLI tools hidden in the Python standard library by kevincox on Thursday June 29, 2023 @05:08PM (#36526724)
You can iteratively add the -e flags just the same.
Re:CLI tools hidden in the Python standard library by yunohn on Friday June 30, 2023 @06:52AM (#36532790)
Sure, for the basic example of 5 simple greps. Usually I have some additional flags or steps in between too.
Re:CLI tools hidden in the Python standard library by knodi123 on Thursday June 29, 2023 @12:09PM (#36522372)
not this? grep -ve 'test/|tests/|idlelib|turtledemo'
Re:CLI tools hidden in the Python standard library by xorcist on Thursday June 29, 2023 @01:52PM (#36524069)
That would be -vE, or you have to escape the pipe symbols.
Re:CLI tools hidden in the Python standard library by bdzr on Thursday June 29, 2023 @04:02PM (#36525926)
Couldn't it also be -vP?
Re:CLI tools hidden in the Python standard library by simonw on Thursday June 29, 2023 @12:55PM (#36523183)
Thanks, that's a useful tip.
Re:CLI tools hidden in the Python standard library by st0le on Thursday June 29, 2023 @04:55PM (#36526588)
Also since ripgrep is already installed "grep -v" can be replaced with "rg -v"