bug-grep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

grep for ^ as a single word


From: Szlovencsak Attila
Subject: grep for ^ as a single word
Date: Wed, 22 Mar 2006 16:43:11 +0100
User-agent: Mozilla Thunderbird 1.0.7-1.1.fc3 (X11/20050929)

Hi!

I have a file like:
--/tmp/test---
^
word1 ^ word2
word1 ^word2 word3
word1 word2^ word3

----
If I want to grep out all lines with a single '^' character as a word, I say

grep '\b\^\b' /tmp/test

but it does not give back the first two lines of the file, as expected.

However

grep '\B\^\B' /tmp/test

archive good results. The same thing happends if I use '$' instead of '^'.

Is it a bug of a ''feature''. I did not find any explanation of this on the web.

Thanks in advance,
Attila






reply via email to

[Prev in Thread] Current Thread [Next in Thread]