So i would like to know, how am i able to match an output results with the text file content. For example i have an output like these:
admins
workers
example
devs
back-office
and then i have a text file (groups-id.txt) which containing something like this:
admins,1
apple,2
sample-text,3
workers,4
example,5
devs,6
back-office,7
hr-admins,8
I try to grep like this. But it will contain the hr-admins group aswell because of admins word.
grep -Ew -i "admins|workers|example|devs|back-office" groups-id.txt
How am i able to grep these words with there numbers(id)?
As of results i would like to have something like this:
admins,1
workers,4
example,5
devs,6
back-office,7