Here is what I want to do..

mkfifo infrequentlog frequentlog
sort -m infrequentlog frequentlog > mylog
funcA > infrequentlog 
funcB > frequentlog 

So that when monitor tail, I can see the dates are sorted from both logs.

tail -f mylog

The problem is that this thing doesn't print until funcA produce something. What I want is that even funcA doesn't produce something for a while, I still get something about funcB


Create a third pipe and continuously copy the first two pipes into it. Then read the third:

while cp infrequentlog mainlog; do :; done &
while cp frequentlog mainlog; do :; done &

sort mainlog > mylog

You will need to repeat the sort as well to get all of the messages.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.