From e4e38d0f3ebaf1bd882840db200c29e93c3a8915 Mon Sep 17 00:00:00 2001 From: dmarakom6 Date: Tue, 29 Jun 2021 09:07:20 +0300 Subject: [PATCH] notegrep: "ws" parameter --- util/notegrep/ws.sh | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 util/notegrep/ws.sh diff --git a/util/notegrep/ws.sh b/util/notegrep/ws.sh new file mode 100644 index 0000000..c9166bf --- /dev/null +++ b/util/notegrep/ws.sh @@ -0,0 +1,23 @@ +:<<'info' +shellnotes - ws.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 + + if grep -vq $regex $DEFAULT_PATH/$notename ; then + + grep -v $regex $DEFAULT_PATH/$notename + + else + echo "Pattern matches the whole file." + return 0 + + fi + +else + echo "This note doesn't exist." + return 0 +fi