From 23f9a6f6e4243b63de7d04c1c5dac38183877c58 Mon Sep 17 00:00:00 2001 From: dmarakom6 Date: Mon, 28 Jun 2021 13:49:28 +0300 Subject: [PATCH] notegrep: "sl" parameter --- util/notegrep/sl.sh | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 util/notegrep/sl.sh diff --git a/util/notegrep/sl.sh b/util/notegrep/sl.sh new file mode 100644 index 0000000..68a8bd6 --- /dev/null +++ b/util/notegrep/sl.sh @@ -0,0 +1,19 @@ +:<<'info' +shellnotes - sl.sh +(C) Dimitris Marakomihelakis +Released under the "All rights reserved" category. See the RIGHTS.txt file +in /docs/github/ for its full text. +info + +if [ -f $DEFAULT_PATH/$notename ]; then + out="$(grep -n $regex $DEFAULT_PATH/$notename | wc -l)" + if [ $out -eq 0 ]; then + echo "No matching lines found." + else + grep -n $regex $DEFAULT_PATH/$notename + fi + +else + echo "No such file." + +fi