diff --git a/util/notegrep.sh b/util/notegrep.sh index f0f913f..505c337 100644 --- a/util/notegrep.sh +++ b/util/notegrep.sh @@ -164,6 +164,11 @@ function notegrep() { export option=$1 . ~/.shellnotes/util/notegrep/cf.sh ;; + -sf | --show-files ) + export regex=$2 + export option=$1 + . ~/.shellnotes/util/notegrep/sf.sh + ;; esac return 0 diff --git a/util/notegrep/sf.sh b/util/notegrep/sf.sh new file mode 100644 index 0000000..f80010c --- /dev/null +++ b/util/notegrep/sf.sh @@ -0,0 +1,14 @@ +:<<'info' +shellnotes - sf.sh +(C) Dimitris Marakomihelakis +Released under the "All rights reserved" category. See the RIGHTS.txt file +in /docs/github/ for its full text. +info + +files="$(grep -rwl $regex $DEFAULT_PATH/* | wc -l)" + +if [ $files -ge 1 ]; then + grep -rwl $regex $DEFAULT_PATH/* +else + echo "No matching files found." +fi \ No newline at end of file