notegrep: "cl" parameter

This commit is contained in:
dmarakom6 2021-06-23 18:20:07 +03:00
parent efe588b12d
commit 2552a92a06
2 changed files with 12 additions and 0 deletions

View file

@ -124,6 +124,9 @@ function notegrep() {
case $option in
-sc | --split-char)
. ~/.shellnotes/util/notegrep/sc.sh
;;
-cl | --count-lines )
. ~/.shellnotes/util/notegrep/cl.sh
;;
*)
echo "Invalid parameter. Proceeding in normal grep mode."

9
util/notegrep/cl.sh Normal file
View file

@ -0,0 +1,9 @@
:<<'info'
shellnotes - cl.sh
(C) Dimitris Marakomihelakis
Released under the "All rights reserved" category. See the RIGHTS.txt file
in /docs/github/ for its full text.
info
out="$(grep $regex $DEFAULT_PATH/$notename | wc -l)"
echo "Compressed $out lines of grep output."