Recent Changes - Search:

Linux News.

Docs

Linux Downloads

Search Packages Ubuntu pack Get Ubuntu Search .deb Search RPM

Error log

Distros

Softwares

Help & Man Pages

Others

Contact

.

Escaped-angle-brackets-mark-word-boundaries


Escaped angle brackets mark word boundaries.


The angle brackets must be escaped, since otherwise they have only their literal character meaning.

Escaped "angle brackets" -- \<...\> -- mark word boundaries.

The angle brackets must be escaped, since otherwise they have only their literal character meaning.

"\<the\>" matches the word "the," but not the words "them," "there," "other," etc.

bash$ cat textfile
This is line 1, of which there is only one instance.
 This is the only instance of line 2.
 This is line 3, another line.
 This is line 4.


bash$ grep 'the' textfile
This is line 1, of which there is only one instance.
 This is the only instance of line 2.
 This is line 3, another line.


bash$ grep '\<the\>' textfile
This is the only instance of line 2.

Reference : http://tldp.org


Edit - History - Print - Recent Changes - Search
Page last modified on August 20, 2012, at 05:26 AM