I need to grep for lines with bunch of names, say "[email protected]", "[email protected]" from a file.txt file.txt has junk which is [email protected] [email protected]. I need to filter these out
Once I get these lines I need to grep for gmail and yahoo and get their counts
List l = new ArrayList{[email protected], [email protected]}
def gmail = ['sh','-c','grep "clientLogin="$l.get(0) file.txt' | grep gmail | wc -l ]
def yahoo = ['sh','-c','grep "clientLogin="$l.get(1) file.txt' | grep yahoo| wc -l ]
This doesn't work. How can I substitute the $l.get(1) value dynamically?