3

I've recently moved from Ubuntu to OS X and I'm finding that the 'tail' command behaves differently.

On Ubuntu I could run

tail -f xyzzy.log | espeak

(To have the computer read me what's happening on IRC, for example.)

However on OS X

tail -F xyzzy.log | say

(which I expected to be equivalent) produces no result.

Presumably this is because the pipe wants to send the complete output of tail to say, but since tail is running constantly (with -f) it never reaches the end of the process and so the output never gets passed to say. Honestly, if I'm understanding this right, this behaviour makes more sense than the behaviour I had on Ubuntu -- it's just less useful.

So is there another way I can achieve the same result? (And are my presumptions about why this is happening correct?)

1 Answer 1

6

See https://apple.stackexchange.com/questions/9673/how-to-correctly-pipe-output-into-say-in-terminal which suggests

 tail -f xyzzy.log | while read line ; do echo $line | say ; done

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .