Search the FAQ Archives

3 - A - B - C - D - E - F - G - H - I - J - K - L - M
N - O - P - Q - R - S - T - U - V - W - X - Y - Z
faqs.org - Internet FAQ Archives

comp.sys.hp.hpux FAQ
Section - 8.53 How do I grep for an exact word as with "grep -w" in Linux?

( Single Page )
[ Usenet FAQs | Web FAQs | Documents | RFC Index | Sex offenders ]


Top Document: comp.sys.hp.hpux FAQ
Previous Document: 8.52 Where can I obtain a free HP-UX shell account?
Next Document: 9. ACKNOWLEDGEMENTS
See reader questions & answers on this topic! - Help others by sharing your knowledge

From 11.11 onwards, the -w option is supported. Otherwise, use:

  $ grep -E "(^|[^[:alnum:]_])(<word_to_be_searched>)([^[:alnum:]_]|$)"

or install GNU grep and use its -w option.

User Contributions:

Comment about this article, ask questions, or add new information about this topic:




Top Document: comp.sys.hp.hpux FAQ
Previous Document: 8.52 Where can I obtain a free HP-UX shell account?
Next Document: 9. ACKNOWLEDGEMENTS

Single Page

[ Usenet FAQs | Web FAQs | Documents | RFC Index ]

Send corrections/additions to the FAQ Maintainer:
hpux.faq@gmail.com





Last Update March 27 2014 @ 02:11 PM