Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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?)

share|improve this question

1 Answer 1

up vote 4 down vote accepted

See http://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
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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