shellnotes/util/notegrep/sl.sh

20 lines
414 B
Bash
Raw Normal View History

2021-06-28 12:49:28 +02:00
:<<'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