Find the answer to your Linux question:
Results 1 to 3 of 3
Hi geeks I have started to learn linux, loving it already, but stuck with a problem, please help me move ahead. Following command getting me results as expected except one ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Sep 2009
    Posts
    8

    grep with regular exp


    Hi geeks

    I have started to learn linux, loving it already, but stuck with a problem, please help me move ahead.

    Following command getting me results as expected except one problem.
    egrep -w -A1 'he.*o'

    the problem is I need to print next line only if the first line ends with a /

    Thanks in advance.

    Leo

  2. #2
    tpl
    tpl is offline
    Linux User
    Join Date
    Jan 2007
    Location
    cleveland
    Posts
    477
    > ...the first line ends with a /

    query whether you intended '\' the line continuation character?
    if so, then one way to do this is, remove the '\' and associated
    newline (use "tr") then "egrep -w" as before
    the sun is new every day (heraclitus)

  3. #3
    Linux Newbie
    Join Date
    Mar 2009
    Posts
    228
    Try this:

    Code:
    grep -w -A1 'he.*o.*/$'

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •