The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com




Thread: using tail -f
View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #2 (permalink)  
Old 10-23-2002
Vishnu Vishnu is offline
Registered User
  
 

Join Date: Aug 2002
Location: Marlboro, MA
Posts: 114
try using

tail -f log_X | grep n >> log_Y

I'm not sure this would work...

I can add that the commands on either side of a pipe "|" are started and executed synchronously... and we know that any command like grep will finish only if it sees an EOF, which "tail -f" will not give as it is in an infinite loop looking for newly appended lines...

so...

tail -f log_X | grep n

should be working fine and giving "new" lines having "n" to stdout as and when they append to log_x...

It may be a problem with redirection, so use redirection in append mode >> and let us know!!

Cheers!
Vishnu.