notegrep: "sf" parameter
This commit is contained in:
parent
09de7c2a1c
commit
7873536b92
2 changed files with 19 additions and 0 deletions
|
@ -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
|
||||
|
||||
|
|
14
util/notegrep/sf.sh
Normal file
14
util/notegrep/sf.sh
Normal file
|
@ -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
|
Loading…
Reference in a new issue