When there is only one match condition: The egrep pattern file is equivalent to the GREP-E pattern file
For example:
When multiple match conditions are available, you can only use egrep-e pattern1-e pattern2-e pattern3 ... filename,
You can't use grep-e pattern1-e pattern2 filename, because grep-e pattern1-e pattern2 filename is bound to have no results. (This shows that the usage on page 125th of the Linux Shell Script Introduction Second edition is wrong):
Oddly, when using egrep, multiple match conditions are used, and the number of results matched is not equal to the sum of the number of results using a single match condition, respectively:
In the above example, the sum of the result numbers using two conditions is 9415528+787768=10203296, but the result number with two matching conditions is 10201972, compared with 1324 results:
grep and Egrep