So I have something that needs some BASH redirection, but it seems to fail
The issue is:
tail -f ~/mysecretlog.log | grep -E "string1|string2"
Ok.. this works, fine..
The problem comes in when I want to save this data to a file, ie redirect stdout to a file. ie:
tail -f ~/mysecretlog.log | grep -E "string1|string2" >> AnotherSecret.log
waahaaahommmppp.. FAIL.
YES. I have tried explicitly telling it to send stdout to the file:
tail -f ~/mysecretlog.log | grep -E "string1|string2" &>> AnotherSecret.log
tail -f ~/mysecretlog.log | grep -E "string1|string2" 1> AnotherSecret.log
Nope. and nope.
No data is added to the file.
The source is a LIVE log data that is derived from another script... Sure it would be great or better or even "proper" to do this via that script... There is a long list of issues as to why thats not going to happen, right now at least.
There is something in this I am missing on redirecting the results that stdout gets fine, to a file.
shrug...
Any one got some hints Thanks!
The issue is:
tail -f ~/mysecretlog.log | grep -E "string1|string2"
Ok.. this works, fine..
The problem comes in when I want to save this data to a file, ie redirect stdout to a file. ie:
tail -f ~/mysecretlog.log | grep -E "string1|string2" >> AnotherSecret.log
waahaaahommmppp.. FAIL.
YES. I have tried explicitly telling it to send stdout to the file:
tail -f ~/mysecretlog.log | grep -E "string1|string2" &>> AnotherSecret.log
tail -f ~/mysecretlog.log | grep -E "string1|string2" 1> AnotherSecret.log
Nope. and nope.
No data is added to the file.
The source is a LIVE log data that is derived from another script... Sure it would be great or better or even "proper" to do this via that script... There is a long list of issues as to why thats not going to happen, right now at least.
There is something in this I am missing on redirecting the results that stdout gets fine, to a file.
shrug...
Any one got some hints Thanks!
Comment