Find the answer to your Linux question:
Results 1 to 3 of 3
Hi guys when I do a grep on a string if the result line has an ending \ and have continuation on the next line, I am not getting that ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Sep 2009
    Posts
    8

    [SOLVED] overriding \ in a grep search


    Hi guys

    when I do a grep on a string if the result line has an ending \ and have continuation on the next line, I am not getting that result on the next line.

    Please help if there is an easy way to override this.

    Leo

  2. #2
    tpl
    tpl is offline
    Linux User
    Join Date
    Jan 2007
    Location
    cleveland
    Posts
    477
    well, one way is to connect the continuations, perhaps
    like this--

    tr \\ " " <filename | tr -d "\n" | tr -s " " >new.filename

    and then grep
    the sun is new every day (heraclitus)

  3. #3
    Just Joined!
    Join Date
    Sep 2009
    Posts
    8

    Thumbs up Here is the solution

    Found it from a friend.

    grep -A1 "heart.*at" prop.txt


    Result:
    ----------
    heartbeat \
    more beats

Posting Permissions

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