I have a bash script I am using to iterate over a list of files and search for regex matches. Here is a snippet from my current code:
for file in $Files_To_Parse; do
(cat $file) | grep -ioE "($Keys$Delimiters$Payload+$End_String)" | grep -v 'null' | grep -v '*'
done
$Files_To_Parse is a string of space separated file names
$Keys, $Delimiters, $Payload$, and End_String are regex patterns.
This code currently works (slowly).
I would like to either have multiple files processed in parallel, or one file which regex matches are searched for in parallel; however, I am not sure how to use GNU's Parallel package to accomplish this.
Thanks for looking.
grep -h pattern "$Files_To_Parse"
- that'll at least give grep several files to look at at a time, instead of one at a time.