Start process & check log until start line found?

Discussion in 'Programming/Scripts' started by naffcat, Nov 11, 2011.

  1. naffcat

    naffcat New Member

    Hi,

    Can anyone help, I need to write a linux shell script which will either tail a log until a particular line appears (with for example "started") or perhaps have a script which has a loop - sleep - grepp check for line - then exit if found.

    I imagine this kind of thing has been done before and there's probably more than one way to do it but would appreaciate any examples

    Many thanks

    :confused:
     
  2. nbhadauria

    nbhadauria New Member

    simple thought use grep -B100000000000 "started"
     
  3. naffcat

    naffcat New Member

    Thanks - problem is there are previous instances of "started" within the log - that's why I was hoping someone might have come across this before - and have some kind of check / sleep / loop until found after present time.
     
  4. nbhadauria

    nbhadauria New Member

    Last edited: Nov 15, 2011

Share This Page