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$'
}
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$'
}
Oh, didn't know about -c. I usually just pipe to wc -l I guess.
-c, -l, -h, -H, and -q are my favorite #grep flags. :D
Huh, that almost became a [Marcel Duchamp] reference. 😅
I just use -v and -E
...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
@amin Absolutely.
@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 😝
@rl_dane @thedoctor @sotolf @mirabilos
Most of those aren't for handling complex data types, though, just manipulating lines.
@amin @thedoctor @sotolf @mirabilos
So far, I've managed to bodge it together just well enough to do what I needed, but I really would like to get more familiar with jq.