Find the answer to your Linux question:
Results 1 to 3 of 3
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1

    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.


  2. #2
    Linux User
    Join Date
    Jan 2007
    > ...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
    Try this:

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

  4. $spacer_open

Posting Permissions

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