Why does the first grep statement below fail to return results, but the modified grep statement below that works? I have tried egrep as well with same results.
cat test
ALL: 192.168.0.0/255.255.0.0, 10.0.0.0/255.0.0.0
grep '^[\s]*ALL[\s]*:[\s]*192.168.0.0/255.255.0.0[\s]*' test
No results
grep '^[\s]*ALL[\s]*: 192.168.0.0/255.255.0.0[\s]*' test
ALL: 192.168.0.0/255.255.0.0, 10.0.0.0/255.0.0.0
Also , when I put a $ at the end, both fail.
grep '^[\s]*ALL[\s]*:[\s]*192.168.0.0/255.255.0.0[\s]*$' test
No results
grep '^[\s]*ALL[\s]*: 192.168.0.0/255.255.0.0[\s]*$' test
No results