File this under #shell #functions I should have written years ago:

function grepc { #Do a grep -c, but skipping files with no results grep -c "$@" |grep -v ':0$' }

#unix #UnixShell #ShellScripting #bash #ksh

@rl_dane

Oh, didn't know about -c. I usually just pipe to wc -l I guess.

@amin

-c, -l, -h, -H, and -q are my favorite #grep flags. :D

Huh, that almost became a [Marcel Duchamp] reference. πŸ˜…

Marcel Duchamp - Wikipedia

@rl_dane

I just use -v and -E

@amin @rl_dane you guys use flags?... :p
@amin @rl_dane @sotolf You guys still use grep instead of ripgrep. Tst

@thedoctor @amin @sotolf

...and bash instead of zsh
...and grep/awk/sed instead of jq
...and firefox instead of chrome
...and the fediverse instead of facebook

Face it... I'm an unpopular-opinion neckbeard level boss. XD

cc: @mirabilos

@rl_dane @thedoctor @sotolf @mirabilos

...and grep/awk/sed instead of jq

Okay, now that one is crazy.

@thedoctor @amin @sotolf @mirabilos

LISTEN, I've used grep/awk/sed for very nearly a quarter century, and I find the syntax of jq bewildering, so 😝

@amin @rl_dane @thedoctor @sotolf jq is absolutely bewildering, especially the insistence on filtering (splitting the input stream is so hard and counter-intuitive), but it’s an ok tool if you have JSON. Or YAML, which I [convert (user=pass public)] to JSON anywwy.

xmlstarlet is lovely!

@mirabilos @amin @thedoctor @sotolf

Is it possible to convert JSON to XML and then use xmlstarlet? πŸ˜„

@rl_dane @mirabilos @amin @thedoctor conversion is always a dangerous step