aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2017-04-28 12:42:51 +1200
committerTom Ryder <tom@sanctum.geek.nz>2017-04-28 12:43:14 +1200
commit99ce821b209b61d19240e4ef95efe2f626025f7e (patch)
tree8a781cac298367d02428c2de27c4a11f08ab9ea3
parentCorrections to quo(1df) man page (diff)
downloaddotfiles-99ce821b209b61d19240e4ef95efe2f626025f7e.tar.gz
dotfiles-99ce821b209b61d19240e4ef95efe2f626025f7e.zip
Add grec(1df) and gred(1df)
-rw-r--r--.gitignore2
-rw-r--r--Makefile2
-rw-r--r--README.markdown2
-rw-r--r--bin/grec.sh2
-rwxr-xr-xbin/gred.sh2
-rw-r--r--man/man1/grec.1df13
-rw-r--r--man/man1/gred.1df13
7 files changed, 36 insertions, 0 deletions
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 <tom@sanctum.geek.nz>
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 <tom@sanctum.geek.nz>