Lets say I have this input
11
12
31
40
42
90
I need to get all number lines from the file and add the |
character after each that can be used as a pattern list to run with grep -f
.
I was thinking of using xargs
but I have no idea how to use |
as a separator or put the args in the middle of a string
grep -P "(11|12|31|40|42|90)\|" o.txt