notegrep: "sl" parameter

This commit is contained in:
dmarakom6 2021-06-28 13:49:28 +03:00
parent e3f7e7414f
commit 23f9a6f6e4

19
util/notegrep/sl.sh Normal file
View file

@ -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