The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
Google UNIX.COM



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

Join Date: Sep 2001
Location: D.C.
Posts: 48
Question using tail -f

Working in HP-UX 10.20. I eventually want to write a bourne shell script to handle the following problem, but for now I am just toying with it at the command line.

Here's what I am basically trying to do:

tail -f log_X | grep n > log_Y

I am doing a tail -f on log_X . Once it sees "n", I would like for it to grep it, then put it into log_Y. It ain't making it to log_Y.

I have been manually adding "n" to log_X, and the tail command is definitely seeing it, but it fails to pass it to log_Y.

Why? Is it because the command is trying to "complete" the tail -f before it executes the > (redirect) to log_Y??

Is there a better way to appraoch this?

TYIA
Reply With Quote
Forum Sponsor