Using `say` to read terminal output from a command line tool

terminal

I'm not sure if this is possible. I'm using a command line log parser for an MMO I play. Information is shown in Terminal window but I have to read it while playing rather than hear it while playing. I'd like to program Terminal to say the output as it's being streamed to the screen.

I'm new to the command line and Terminal– is there a way to do this?

Best Answer

<command> 2>&1 | while read line ; do echo $line | say ; done

Replace <command> with the normal command that outputs what you would like to be spoken.