just grep implies certain features not available with all grep versions
* not clear what number of occurrences refers to:
a) 6/10 search strings found in directory files
b) 600 total matches found in 4/10 files in directory
example below assumes "600" is what's wanted.
* "occurrences: string[] ":
provide just the matching string & number of time occurs in fileor include the "0" matches too?
in given example, "0" occurrences are "dropped"
-----
initial stuff:
example shell command preceded by #
file with list of paths to use, one per line -> dirscan.txt (directory scans)
file with list of paths to exclude, one per line -> dirskip.txt (directory excludes)
file with list of strings to mach, one per line -> strchk.txt (string matches)
----
command sequence outline:
1.) non-grep: from moreutilities, combine preserves order & no need to sort
# combine dirscan.txt not dirskip.txt
2.)
a) use find command to eliminate some edge cases while walking list of sorted directories from #1 to create sorted directory/files list in file dirlist.txt
( some edge cases: special files, no permissions, etc.)
b) use dirlist.txt with find:
1) if '-type d' print path to give to # grep -c -F strchk.txt \*
to print total number string instances in strchk.txt found in all files in directory.
2) if '-type f' print file to give to # grep -c -F strchk.txt
to display instances of strchk.txt strings (file, string, number of times appears in file.
note: display only when strchk.txt string occurrence is greater than 0
just grep implies certain features not available with all grep versions
* not clear what number of occurrences refers to:
a) 6/10 search strings found in directory files
b) 600 total matches found in 4/10 files in directory
example below assumes "600" is what's wanted.
* "occurrences: string[] ":
provide just the matching string & number of time occurs in fileor include the "0" matches too?
in given example, "0" occurrences are "dropped"
-----
initial stuff:
example shell command preceded by #
file with list of paths to use, one per line -> dirscan.txt (directory scans)
file with list of paths to exclude, one per line -> dirskip.txt (directory excludes)
file with list of strings to mach, one per line -> strchk.txt (string matches)
----
command sequence outline:
1.) non-grep: from moreutilities, combine preserves order & no need to sort
# combine dirscan.txt not dirskip.txt
2.) a) use find command to eliminate some edge cases while walking list of sorted directories from #1 to create sorted directory/files list in file dirlist.txt
( some edge cases: special files, no permissions, etc.)
b) use dirlist.txt with find: