From 99ce821b209b61d19240e4ef95efe2f626025f7e Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Fri, 28 Apr 2017 12:42:51 +1200 Subject: Add grec(1df) and gred(1df) --- .gitignore | 2 ++ Makefile | 2 ++ README.markdown | 2 ++ bin/grec.sh | 2 ++ bin/gred.sh | 2 ++ man/man1/grec.1df | 13 +++++++++++++ man/man1/gred.1df | 13 +++++++++++++ 7 files changed, 36 insertions(+) create mode 100644 bin/grec.sh create mode 100755 bin/gred.sh create mode 100644 man/man1/grec.1df create mode 100644 man/man1/gred.1df diff --git a/.gitignore b/.gitignore index 660e0ddb..bb4e5163 100644 --- a/.gitignore +++ b/.gitignore @@ -28,6 +28,8 @@ bin/finc bin/fnl bin/gms bin/grc +bin/grec +bin/gred bin/gscr bin/gwp bin/han diff --git a/Makefile b/Makefile index f7f90575..1f06814c 100644 --- a/Makefile +++ b/Makefile @@ -104,6 +104,8 @@ BINS = bin/ap \ bin/fnl \ bin/gms \ bin/grc \ + bin/grec \ + bin/gred \ bin/gscr \ bin/gwp \ bin/han \ diff --git a/README.markdown b/README.markdown index 85aca3a2..14b15ff5 100644 --- a/README.markdown +++ b/README.markdown @@ -488,6 +488,8 @@ Installed by the `install-bin` target: * `gms(1df)` runs a set of `getmailrc` files; does much the same thing as the script `getmails` in the `getmail` suite, but runs the requests in parallel and does up to three silent retries using `try(1df)`. +* `grec(1df)` is a more logically-named `grep -c`. +* `gred(1df)` is a more logically-named `grep -v`. * `gwp(1df)` searches for alphanumeric words in a similar way to `grep(1)`. * `han(1df)` provides a `keywordprg` for Vim's Bash script filetype that will look for `help` topics. You could use it from the shell too. diff --git a/bin/grec.sh b/bin/grec.sh new file mode 100644 index 00000000..035b7cce --- /dev/null +++ b/bin/grec.sh @@ -0,0 +1,2 @@ +# g/re/c +grep -c "$@" diff --git a/bin/gred.sh b/bin/gred.sh new file mode 100755 index 00000000..46de5dce --- /dev/null +++ b/bin/gred.sh @@ -0,0 +1,2 @@ +# g/re/d +grep -v "$@" diff --git a/man/man1/grec.1df b/man/man1/grec.1df new file mode 100644 index 00000000..8759aa33 --- /dev/null +++ b/man/man1/grec.1df @@ -0,0 +1,13 @@ +.TH GREC 1df "April 2017" "Manual page for grec" +.SH NAME +.B grec +\- saner name for grep -c +.SH SYNOPSIS +.B grec PATTERN [FILE...] +.br +.SH DESCRIPTION +.B grec +is the same as grep(1) when run with a a -c option, because the name always +bugged me a bit--"g/re/p, except don't print it, count it"? +.SH AUTHOR +Tom Ryder diff --git a/man/man1/gred.1df b/man/man1/gred.1df new file mode 100644 index 00000000..8fcc4d74 --- /dev/null +++ b/man/man1/gred.1df @@ -0,0 +1,13 @@ +.TH GRED 1df "April 2017" "Manual page for gred" +.SH NAME +.B gred +\- saner name for grep -v +.SH SYNOPSIS +.B gred PATTERN [FILE...] +.br +.SH DESCRIPTION +.B gred +is the same as grep(1) when run with a a -v option, because the name always +bugged me a bit--"g/re/p, except don't print it, delete it"? +.SH AUTHOR +Tom Ryder -- cgit v1.2.3