I have been learning linux commands and got this error. My text is here:
Fred apples 20
Susy oranges 12
Mark watermellons 12
Robert pears 4
Terry oranges 9
Lisa peaches 7
Egemen aaaa 12
Susy oranges 12
Mark grapes 39
Anne mangoes 7
Greg pineapples 3
Oliver rockmellons 2
Betty limes 14
I searched for the lines not ending with 2
. My command:
egrep '2.+' mysampledata.txt
But interestingly I got these two lines:
Fred apples 20
Susy oranges 12
I tried some other arguments for these command and changed the sequence of the lines. I did not got any false result.
What's wrong with this construction?
2.+
does not specify a line ending in2
. You might instead look to2$
.