Re: Grep For Line Containing 1or 2 Words
From: Andrew Schulman (andrex_at_deadspam.com)
Date: 01/27/05
- Next message: Levente KOVACS: "Re: which linux distro for a FreeBSD user looking for something new"
- Previous message: Roy Shimmyo: "Re: which linux distro for a FreeBSD user looking for something new"
- In reply to: Buck Turgidson: "Grep For Line Containing 1or 2 Words"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Thu, 27 Jan 2005 12:10:56 -0500
> Looking for help in writing a grep (or perl) that will pull from a
text file
> those lines containing one or two "words". I want to reject any line that
> contains more than 2 words (a sentence).
grep -v '[^ ]+ +[^ ]+ +[^ ]+'
Not pretty, but that's grep for you.
-- To reply by email, replace "deadspam.com" by "alumni.utexas.net"
- Next message: Levente KOVACS: "Re: which linux distro for a FreeBSD user looking for something new"
- Previous message: Roy Shimmyo: "Re: which linux distro for a FreeBSD user looking for something new"
- In reply to: Buck Turgidson: "Grep For Line Containing 1or 2 Words"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|