-   Linux - Newbie (
-   -   Use named fifo to do a useful and funny thing (

wang 10-04-2012 02:43 AM

Use named fifo to do a useful and funny thing

We know that the espeak command can speak out anything you give to it,and I want
to use it to work together with the elinks command to scan any English website with its contents being read at the same time.So,my clever friends,any good ideas?

Still,I wonder if I can just type "myCommand theWebSite" to do it for saving types.

I think this may be related with fifo and alias,but i just can't figure out a method.
Thanks in advance!

henrycoffin 10-05-2012 08:59 AM

Surely espeak would just read out the html code????????

wang 10-11-2012 10:14 AM

Sorry for replying to you so late.
But I am afraid that you have not tried that yet.

  elinks | cat | espeak
That's it.But what I want is to browse the somesite at the same time.
And I wonder if I could divide the flow produced by "elinks | cat" into two parts,one for espeak,and the other for stdout,thus listening and reading at the same time.

ntubski 10-12-2012 09:41 AM

cat never divides the flow, it only concatenates files; or, to continue the pipe metaphor, merges files into the flow. For dividing flow you want to use tee. The info page for tee shows some examples using the shell's process substitution.

For your case, it would be something like this:

elinks | tee >(espeak)

All times are GMT -5. The time now is 08:14 PM.