I have created a ugrep command and file
ugrep -Hn -e 'Error:XX234 - \S+\.txt : cannot find user' -e 'Error:XX235 - \S+\.pdf : cannot find data' --format='%f:%n:%o%~' *
File content
1_Error0: rwPqdEPE.txt - YjTccJITSpALx1B8cORNErrorXX235 - xyz.pdf : cannot find dataError:XX235 - xyz.pdf : cannot find dataError:XX234 - abc.txt : cannot find user
Output
I am expecting below in the output:
- display which pattern was matched with error
Above is just a sample ugrep command. my actual command will be quite big like below
ugrep -Hn -e pattern1 -e pattern2 -e patternN --format='%f:%n:%o%~' *
Expected output
issue.txt:12:Error:XX235 - xyz.pdf : cannot find data:<pattern2>issue.txt:13:Error:XX234 - abc.txt : cannot find user:<patternN>