Article 5S5M7 File matches with structured information

File matches with structured information

by
Faki
from LinuxQuestions.org on (#5S5M7)
The following grep command that returns the files that contain the string ptrn.

Code:grep -rl "${isufx[@]}" -e "$ptrn" -- "${fdir[@]}" >> $logflThis would be the result

Code:cat /home/flora/logs/27043-T13:09:44.893003954.log
%rec: edvart
Ptrn: Gnu
/home/flora/file1.sh
/home/flora/file2.sh
/home/flora/file3.sh
/home/flora/file4.sh
/home/flora/file5.sh
/home/flora/file6.shI would like to end up with the following

Code:cat /home/flora/logs/27043-T13:09:44.893003954.log
%rec: edvart
Ptrn: Gnu
File: file1.sh
+ /home/flora/file2.sh
+ /home/flora/file3.sh
+ /home/flora/file4.sh
+ /home/flora/file5.sh
+ /home/flora/file6.shlatest?d=yIl2AUoC8zA latest?i=mwF5It6rkOs:QlAHS5i8xQQ:F7zBnMy latest?i=mwF5It6rkOs:QlAHS5i8xQQ:V_sGLiP latest?d=qj6IDK7rITs latest?i=mwF5It6rkOs:QlAHS5i8xQQ:gIN9vFw
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments