Some version of egrep does not have -o option, use gawk for processing instead