lunatechian (lunatech-ian)

one relating to, belonging to, or resembling lunatech

egrep - searching for more than one pattern at a time

Thanks to egrep for linguists for giving this nice and clear example of using egrep.

There are different ways to match both star and stars within a single search pattern. The most straightforward way might be to tell egrep to look for either the string star or the string stars with the help of a disjunction, expressed with the vertical bar, |. This time the search pattern has to be quoted in order for the program to know where the search pattern starts and ends
    $ egrep -w 'star|stars' sonnets.txt
    Not from the stars do I my judgement pluck,
    And constant stars in them I read such art
    Whereon the stars in secret influence comment.
    Let those who are in favour with their stars,
    Till whatsoever star that guides my moving,

Defined tags for this entry:

Trackbacks

Trackback specific URI for this entryTrackback URL

Comments

    • Posted byDeepti
    • on
    Yeah tht was really helpful.
    Reply
    • Posted byAnonymous
    • on
    'star(s)?'
    Reply
  1. what about "star|tsar" :-)
    Reply

Add Comment

Enclosing asterisks marks text as bold (*word*), underscore are made via _word_.
Standard emoticons like :-) and ;-) are converted to images.
E-Mail addresses will not be displayed and will only be used for E-Mail notifications.