cat > abc.txt <<EOF
2014-04-11 00:00:00
2014-02-19 00:22:00
EOF
When I execute
grep -E :[0-9]{2}: abc.txt
I get
2014-02-19 00:22:00
I was expecting
2014-04-11 00:00:00
2014-02-19 00:22:00
This happens on fish shell (2.4.0), on bash it works fine. I am quite intrigued with whats going on here
In fish
{a,b,c}
is an enumerator. Example of use from the documentation:So, your regular expression expands as
:[0-9]2:
:Escape the curly braces to avoid this:
Or, as suggested by Fredrik, quote the whole regular expression: