problem with a script

Hello again,

I have a script to read the last line writed in a file, make a grep and if the grep match, write this line into another file (that is what i want)

script
tail -f router_transaction.log | grep 'R-.*_RESP' | grep -v 0x00000000

this show me in screen what i want but when i change it to:

tail -f router_transaction.log | grep 'R-.*_RESP' | grep -v 0x00000000 >> errores
the errores file dont fill with what i want... why?

evey i try:

tail -f router_transaction.log | grep 'R-.*_RESP' | grep -v 0x00000000 > errores

but dont work, why?

tail -f is a constant stdout command... You can't capture it and pipe to an output. The tail -f is waiting to update with new info coming into the file and will never complete your command line. it will appear to hang.

You will have to either do a tail -NNN where N is some number or cp to a filename then capture the data you want.

but you can 'tee -a' it

vgersh please could you explain me better your command? i maen, can i do:

tee -a <source> <new> ???

Maybe i need to explain better what i have and what i need.

In 'errores.log' i have a lot of transactions logs, succesfull and with errors, another process fill this file in real time.

i want to get all thet logs with errors and fill another file with them.

Is this more clrear?